QToolTip style for opacity and color not working on Windows 11
Unsolved
General and Desktop
-
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.
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!
-
@Rory_1 I am running into the same issue and wrote a bug report FYI:
https://bugreports.qt.io/browse/QTBUG-116021I'll let you know if I find a workaround.
-
@esmolikowski Thanks!