PDA

View Full Version : Which widges does setStyle influence? (PySide)



neuronet
11th June 2014, 13:35
When you use setStyle, which types of Widgets will it affect? It seems to do nothing with a bare QLabel widget, as I documented here (and which I thought was an error):
http://stackoverflow.com/questions/24113001/applying-setstyle-to-qlabel-in-pyside-pyqt

Is there documentation on this somewhere, or is this something I should just find by trial and error?

And is this the best-practices way to change style in PySide?

QtGui.QApplication.setStyle(QtGui.QStyleFactory.cr eate('Cleanlooks'))

anda_skoa
11th June 2014, 14:24
The application style should affect all widgets.

However, depending on the type of widget the changes could be very small or not exist at all.

Have a look at the Qt Widget gallery: http://qt-project.org/doc/qt-4.8/gallery.html

Cheers,
_

neuronet
12th June 2014, 02:04
Thanks for the link! I guess for a single widget that just contains a label it doesn't show up, but once you have buttons and such within a widget it will have an influence. Thanks again.