How to set custom style to specific widgets in an application



  • Hello,

    I have made a style subclass where I am creating a custom look and feel. I want to use this style to only the QDialogs of my application that are more than one at the moment. When I set my custom style, for the sake of testing, to the whole application, it works. But When I try to set it to specific widgets it doesn't do anything.

    Is there something in particular that I must do to apply a style to the widgets I want in an application??

    I would appreciate any help, thanks!



  • I would recommend you to have a look at "Qt style sheets examples":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html.



  • Thanks! That is a good option and I am using style sheets where I can and in that case it does work. But I still want to try to grasp how to subclass from one of Qt's style classes to then be able to make my own widgets (buttons, sliders, etc) and of course how to apply that style to what I want without necessarily having to apply the style to the whole application.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.