PDA

View Full Version : Linking text in qlineedit to URL



padma
3rd March 2017, 18:20
I am currently using a QLineEdit widget to input some text, which is the linktext to a predefined hyperlink.
When the user clicks on the text in the QLineEdit, it should open up the URL in the browser, and pass the link text as an argument.

How do I associate a URL to the QLineEdit?

anda_skoa
4th March 2017, 12:54
There are various ways to detect a click in a widget.

One is to derive from the widget class in question, in your case QLineEdit, and implement mousePressEvent() and mouseReleaseEvent().
Another is is to install an event filter that checks for these events.

Cheers,
_