Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QToolTip style for opacity and color not working on Windows 11
Forum Updated to NodeBB v4.3 + New Features

QToolTip style for opacity and color not working on Windows 11

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtooltip
3 Posts 2 Posters 338 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rory_1
    wrote on 26 Jul 2023, 13:55 last edited by
    #1

    I am able to set the color and opacity for tooltips in Qt 6.5.2 MacOS, but not on Qt 6.5.2 on a PC running Win11. Here is a minimum reproducible gaudy sample.

    test.pro

    QT += core gui widgets
    SOURCES += main.cpp
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

    main.cpp

    #include <QApplication>
    #include <QMainWindow>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QMainWindow mw;
        QString s =
            "QToolTip {"
            "opacity: 100;"             // does not work on windows
            "color: yellow;"            // does not work on windows
            "background-color: red;"
            "border-width: 2px;"
            "border-style: solid;"
            "border-color: magenta;"
            "margin: 2px;"
            "font-size: 20pt;"
            "}";
        mw.setStyleSheet(s);
        mw.setToolTip("Testing");
        mw.show();
        return a.exec();
    }
    

    Any tips (haha) to solve this much appreciated!

    E 1 Reply Last reply 16 Aug 2023, 00:33
    0
    • R Rory_1
      26 Jul 2023, 13:55

      I am able to set the color and opacity for tooltips in Qt 6.5.2 MacOS, but not on Qt 6.5.2 on a PC running Win11. Here is a minimum reproducible gaudy sample.

      test.pro

      QT += core gui widgets
      SOURCES += main.cpp
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      

      main.cpp

      #include <QApplication>
      #include <QMainWindow>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow mw;
          QString s =
              "QToolTip {"
              "opacity: 100;"             // does not work on windows
              "color: yellow;"            // does not work on windows
              "background-color: red;"
              "border-width: 2px;"
              "border-style: solid;"
              "border-color: magenta;"
              "margin: 2px;"
              "font-size: 20pt;"
              "}";
          mw.setStyleSheet(s);
          mw.setToolTip("Testing");
          mw.show();
          return a.exec();
      }
      

      Any tips (haha) to solve this much appreciated!

      E Offline
      E Offline
      esmolikowski
      wrote on 16 Aug 2023, 00:33 last edited by
      #2

      @Rory_1 I am running into the same issue and wrote a bug report FYI:
      https://bugreports.qt.io/browse/QTBUG-116021

      I'll let you know if I find a workaround.

      R 1 Reply Last reply 17 Aug 2023, 22:57
      0
      • E esmolikowski
        16 Aug 2023, 00:33

        @Rory_1 I am running into the same issue and wrote a bug report FYI:
        https://bugreports.qt.io/browse/QTBUG-116021

        I'll let you know if I find a workaround.

        R Offline
        R Offline
        Rory_1
        wrote on 17 Aug 2023, 22:57 last edited by
        #3

        @esmolikowski Thanks!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved