Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.2
-
None
-
Linux 64-bit
Description
With the following example, if the mouse if moved over the link, the linkHovered signal is emitted. If the mouse is then moved off of the link and then back on, the linkHovered signal is not emitted. Because the enter/leave signals are not being tracked, the QLabel is stuck in a linkHovered stated even though the mouse left and reentered the label.
#include <QtGui> class Echo : public QObject { Q_OBJECT public: Echo(QObject *parent = 0) : QObject(parent) {} public slots: void echo(const QString &text) { qDebug() << text; } }; int main(int argc, char **argv) { QApplication app(argc, argv); QWidget w; QVBoxLayout *layout = new QVBoxLayout(&w); QLabel *label = new QLabel("<a href='test'>This is a link</a>"); layout->addWidget(label); QObject::connect(label, SIGNAL(linkHovered(QString)), new Echo(label), SLOT(echo(QString))); w.show(); return app.exec(); }