[QGIS-Developer] Problems configuring the statusBar

Nyall Dawson nyall.dawson at gmail.com
Sun Dec 11 13:21:49 PST 2022


On Mon, 12 Dec 2022, 7:06 am afernandez via QGIS-Developer, <
qgis-developer at lists.osgeo.org> wrote:

> Hello Andrea,
> Sorry for the delay as it has been a busy Sunday with several commitments.
> I've been trying to implement your proposed solution using different
> approaches but still unsucessfully (even after trying different
> combinations). From several posts, a potential syntax would be something
> like:
>         variable1 = self.iface.mainWindow().statusBar().styleSheet()
>         variable1.setstyleSheet("background-color: black;")
> However, this is not effective and 'variable' is returning
> QStatusBar::item{border: none;}, which I'm unsure how to intepret or how to
> define the variable so that setstyleSheet can be applied.
> I also tried a more simplified version (following the suggestion at
> https://stackoverflow.com/questions/23490017/how-to-add-style-via-setstylesheet-without-losing-orignal-style-in-qt
> ):
>         setstyleSheet("background-color: black;")
>         self.iface.mainWindow().statusBar().styleSheet()
> However, it returns 'setstyleSheet' is not defined so it doesn't seem to
> take setstyleSheet w/o an assignment. Do you have any suggestion on how you
> would proceed?
>

Respectfully, your code has many fundamental issues. I would suggest
reading the qt documentation and getting a better grasp on qt and the qt
API before attempting to write this script.

Nyall

Thanks,
> AF
> P.S. My apologies for the previous reply (it didn't go as anticipated)
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20221212/98a4c64f/attachment-0001.htm>


More information about the QGIS-Developer mailing list