'color' of QToolTip stylesheet not working
Unsolved
Qt for Python
-
I am using python 3.11.1 and pyside 6.5.2.
I wrote a style sheet for my tooltips as following and set this sheet on my main window.QToolTip { color: red; }
But the text of tooltip did not change to red.
I tested the same style sheet on pyside 6.4.2, it worked.
Is there a something changed to applying style sheet between 6.5.2 and 6.4.2? -
Hi,
Can you provide a minimal script to test that ?
By the way, on which OS are you running ? -
@SGaist
Oh I am using windows 10 pro 22H2 19045.3448 build.
You can get the problem through a simple example.import sys from PySide6.QtCore import * from PySide6.QtWidgets import * from PySide6.QtGui import * class mainwindow(QMainWindow): def __init__(self) -> None: super().__init__() layout = QHBoxLayout(self) button = QPushButton("this is a button", self) button.setToolTip("this is a tooltip") button.resize(200, 200) layout.addWidget(button) self.resize(400, 400) self.setStyleSheet("QToolTip { color: red; }") if __name__ == "__main__": app = QApplication(sys.argv) m = mainwindow() m.show() sys.exit(app.exec())
Or can see it by using widget designer of pyside6.
In version 6.5.2, you can see that the 'color' of the stylesheet for QToolTip is not working.