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

Stylesheet with "padding" is partially broken for tooltip

    XMLWordPrintable

Details

    • Windows

    Description

      A minimal snippet:

      #include <QApplication>
      #include <QPushButton>
      #include <QVBoxLayout>
       
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
       
          QWidget *main = new QWidget;
          QVBoxLayout *layout = new QVBoxLayout(main);
       
          main->setStyleSheet("QToolTip {"
                              "padding: 20px;"
                              "}");
       
          QPushButton *btn1 = new QPushButton("Button 1", main);
          btn1->setToolTip("Tooltip 1");
          QPushButton *btn2 = new QPushButton("Button 2", main);
          btn2->setToolTip("Tooltip 2");
       
          layout->addWidget(btn1);
          layout->addWidget(btn2);
       
          main->setLayout(layout);
          main->show();
       
          return a.exec();
      }
      

      So simply 2 buttons with tooltip set, and stylesheet is set to main window (but it actually does not change anything if stylesheet is set to 2 buttons individually).

      Problem being observed:
      I hover cursor over one button and tooltip is correctly padded (I can see larger box). But once I move my cursor QUICKLY (maybe need to be quick enough so that the first tooltip is not yet completely gone) over to the other button then the tooltip for that button is not padded at all. Only if I can make sure that the first tooltip is gone (by move cursor away and then wait a while before I hover over the other button) then the new tooltip can be padded correctly.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes