Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12768

QLabel's linkHovered signal is not re-emitted if mouse movement exits and re-enters the over the linked text.

    XMLWordPrintable

Details

    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();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            baysmith Bradley Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes