How to insert QPushButton into a QLabel (PyQt4)?

512 views Asked by At

I want to add buttons into a text on pyqt4. But I don't find any solution or an example codes.

1

There are 1 answers

0
ekhumoro On

There is no way to do this, because Qt's rich-text only supports a limited subset of html, which does not include buttons.

Probably the best compromise is to use links within the text, and connect to the label's linkActivated signal. This signal sends the url of the link, so if each link is given a href "name", it will allow you to identify which one was clicked.