While mouse hovers on a label, then a window with a clickable link pops up.
When the link is clicked, or mouse leave the label, or mouse leave the popup window,
the popup window will be closed.
How to implement it?
Any help is appreciated.
While mouse hovers on a label, then a window with a clickable link pops up.
When the link is clicked, or mouse leave the label, or mouse leave the popup window,
the popup window will be closed.
How to implement it?
Any help is appreciated.
Reimp the handlers QWidget::enterEvent() and QWidget::leaveEvent(). Open and close the pop up there.
what have you tried so far and how does your code look like?
You should make a new class inheriting from QLabel class.
In the new class, put the declaration of Widget events under the "signals:".
Then, connect the signals to your slots.
For example:
class myClass : public QLabel
...
signals:
void mouseReleaseEvent(QMouseEvent *);
...
public slots:
void mySlot();
in the constructor:
connect(this, SIGNAL(mouseReleaseEvent(QMouseEvent*)), this, SLOT(mySlot()));
Bookmarks