I have an PYQT4 application. I try to display a lot of differnt messages based on user interaction. The problem I have is the displayed message using QMessageBox doest come up in clean look style, whereas the other part of the application works well with Clean look style.
I try to use the following code but it doenst work for the message.
# set messagebox properties
msgbox=QMessageBox()
font = QFont()
font.setFamily(_fromUtf8("Levenim MT"))
font.setPointSize(15)
msgbox.setFont(font)
msgbox.setStyle(QStyleFactory.create('Cleanlooks'))
msgbox.information(self,"Download Message", "donuts")
can someone tell me how to make this in clean look style as well
To change the style of your application, you should use
QApplication.setSyle
, then you have a consistent style in your whole GUI.Setting a QWidgets's style only sets the style for the widget itself.
QWidget.setStyle
:That means if you want to change the style of a widget and all it's children, you need to explicitly set it for all children by iterating through them: