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

QToolTip with image is not updated correctly

XMLWordPrintable

      If two widgets are created and images are set to their tooltips (like <img src="...." width="128" height="128">). When the application is started, show the first tooltip (normally with mouse cursor) and then (when tooltip is showed) change cursor position to show the second tooltip, it still shows the same image for the second tooltip.

      Example code:

      #include <QApplication>
      #include <QVBoxLayout>
      #include <QWidget>

      class MyWidget : public QWidget
      {
      public:
      MyWidget(QWidget *parent = 0);
      };

      MyWidget::MyWidget(QWidget *parent)
      : QWidget(parent)
      {
      QWidget *w1 = new QWidget();
      w1->setToolTip("<img src=\"C:\\Users\\Pictures\\image1.png\" width=\"128\" height=\"128\"/>");

      QWidget *w2 = new QWidget();
      w2->setToolTip("<img src=\"C:\\Users\\Pictures\\image2.png\" width=\"128\" height=\"128\"/>");

      QVBoxLayout *layout = new QVBoxLayout;
      layout->addWidget(w1);
      layout->addWidget(w2);
      setLayout(layout);
      }

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);
      MyWidget widget;
      widget.show();
      return app.exec();
      }

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

            bjnilsen Bjørn Erik Nilsen
            xcm Martin Petersson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes