Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set custom style to specific widgets in an application
Forum Updated to NodeBB v4.3 + New Features

How to set custom style to specific widgets in an application

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sergex
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

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

      http://anavi.org/

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sergex
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved