Take a look here.
http://doc.trolltech.com/4.5/widgets-styles.html
In This example the custom style class inherited by QMotifStyle. You can derive your style class by QWindowsStyle or any inbuilt style class depending on your basic requirement.
Take a look here.
http://doc.trolltech.com/4.5/widgets-styles.html
In This example the custom style class inherited by QMotifStyle. You can derive your style class by QWindowsStyle or any inbuilt style class depending on your basic requirement.
Use QPalette instead.
Qt Code:
gradient.setColorAt(0, Qt::black); gradient.setColorAt(1, Qt::white); dialog.setPalette(palette);To copy to clipboard, switch view to plain text mode
1. The title of this post says that he want to use QStyle.
2. Qt Docs says:Customizing a dialogs background with QStyle
For example, the following style sheet specifies that all QLineEdits should use yellow as their background color, and all QCheckBoxes should use red as the text color:
QLineEdit { background: yellow }
QCheckBox { color: red }
For this kind of customization, style sheets are much more powerful than QPalette.
Bookmarks