Hey AF,
oh, looks like the help() for those Qt objects is not as comprehensive
as I hoped.
>>> type(iface.mainWindow().statusBar())
<class 'PyQt5.QtWidgets.QStatusBar'>
https://doc.qt.io/qt-5/qstatusbar.html ->
https://doc.qt.io/qt-5/qstatusbar-members.html ->
https://doc.qt.io/qt-5/qwidget.html#styleSheet-prop
>>> iface.mainWindow().statusBar().setStyleSheet("background-color:red;")
Now my status bar is red.
No idea about fonts...
Have fun!
Hannes
Am 13.12.22 um 03:40 schrieb afernandez:
Hello Johannes,
Querying was how I found the method
self.iface.mainWindow().statusBar().styleSheet() along with many
others. I circled back and tried to use 'help' to figure out what I
was missing. However, help for
self.iface.mainWindow().statusBar().styleSheet() only tells me that
styleSheet is a method of the self.iface.mainWindow.statusBar instance
that returns a string. I also explored another method
self.iface.mainWindow().statusBar().setFont(), which is supposed to
take a QFont, but I still haven't been able to make it work properly
either.
The bottom line is that I can add widgets to the statusBar and style
them, but even changing the font type for the whole statusBar remains
elusive. At least this route allows me to move on with the project
while I figure out all the other details.
Thanks,
AF
--
Johannes Kröger / GIS-Entwickler/-Berater
---------------------------------------------
Where2B Konferenz 2022
15. Dezember 2022 in Bonn und Online
https://where2b-conference.com/
---------------------------------------------
WhereGroup GmbH
Grevenweg 89
20537 Hamburg
Germany
Tel: +49 (0)228 / 90 90 38 - 36
Fax: +49 (0)228 / 90 90 38 - 11
johannes.kroe...@wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer