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

Setting background-color for QToolTip does not work unless border is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.2
    • Widgets: Style Sheets
    • None
    • Windows 7 64 bit
      MSVC 2010

    Description

      1. Run the following code:
        #include <QApplication>
        #include <QToolButton>
        
        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
            QToolButton button;
            button.setStyleSheet( "QToolTip {border: 0px;\
                                             background-color: rgb(0, 255, 0);}");
            button.setToolTip("my tooltip");
            button.show();
        
            return a.exec();
        }
        
      2. Hover the button.
        You'll see a green tool tip:
      3. Remove "border: 0px;" from the style sheet.
      4. Run the application and hover the button:
        The tool tip shows up in default color:

      My understanding is that the background color should still be green.

      Attachments

        1. green.png
          7 kB
          Robert Löhning
        2. default.png
          6 kB
          Robert Löhning

        Issue Links

          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
              rlohning Robert Löhning
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes