![]() |
Setting colour of text in QT QLabel
Is there a simple means for setting the colour of text in a QLabel widget? There doesn't seem to be a property for this and the documentation only mentions text colour in the context of displaying small rich text documents.
|
Use <span style="color:red">your text</span>
or if you dont want to use rich text label.setStylesheet('QLabel { color: red }') or if you dont want to use stylesheets: pal = QPalette(label.palette()) pal.setColor(QPalette.WindowText, QColor(Qt.red)) label.setPalette(pal) |
Thanks. I tried the rich text method and it works a treat. :)
|
| All times are GMT -4. The time now is 10:55 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.