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. Palette not properly applied when customized in editor
Forum Updated to NodeBB v4.3 + New Features

Palette not properly applied when customized in editor

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 220 Views 2 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.
  • I Offline
    I Offline
    ian28
    wrote on last edited by ian28
    #1

    Hello I just started to fiddle with color palettes and stylesheets using the "Fusion" style and came across some problems.

    When changing the palette of my MainWindow it seems that items of a combobox are not affected. However, when loading the same palette in code then the palette does get applied to them.

    When applying a stylesheet to my MainWindow or centralwidget with the following content, the Pushbutton is styled correctly but it also affects the styles of different other elements like text of labels, slider colors. It seems they are resettet to the default color style.

    QPushButton:checked {
    	background-color: rgb(61, 182, 66);
    }
    

    Loading the palette in code fixes this again. Am i missing something here? Also what is the general workflow in Qt when styling and customizing widgets?

    Axel SpoerlA 1 Reply Last reply
    0
    • I ian28

      Hello I just started to fiddle with color palettes and stylesheets using the "Fusion" style and came across some problems.

      When changing the palette of my MainWindow it seems that items of a combobox are not affected. However, when loading the same palette in code then the palette does get applied to them.

      When applying a stylesheet to my MainWindow or centralwidget with the following content, the Pushbutton is styled correctly but it also affects the styles of different other elements like text of labels, slider colors. It seems they are resettet to the default color style.

      QPushButton:checked {
      	background-color: rgb(61, 182, 66);
      }
      

      Loading the palette in code fixes this again. Am i missing something here? Also what is the general workflow in Qt when styling and customizing widgets?

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @ian28
      Customizing palettes of widgets is one way, setting style sheets is another. Mixing both approaches can result in resetting palettes to default brushes/colors, when a style sheet is applied after palettes were customized. The exact behavior, however, depends on your widget hierarchy. You'd have to post more code to analyze that in detail.

      Software Engineer
      The Qt Company, Oslo

      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