QToolTip style for opacity and color not working on Windows 11
-
wrote on 26 Jul 2023, 13:55 last edited by
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!
-
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!
wrote on 16 Aug 2023, 00:33 last edited by@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.
-
@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.
wrote on 17 Aug 2023, 22:57 last edited by@esmolikowski Thanks!