Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Change control type styling via qtquickcontrols2-configuration?
Forum Updated to NodeBB v4.3 + New Features

Change control type styling via qtquickcontrols2-configuration?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 342 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.
  • E Offline
    E Offline
    eragon
    wrote on last edited by
    #1

    Can I use the qtquickcontrols2.conf file to globally style controls such as Buttons and Labels?

    For example can I do something like the following?

    [Controls]
    Style=Material
    
    [Material]
    Theme=Dark
    
    [Material\Button]
    Text=Red
    
    [Material\Label]
    Color=Red
    

    The above isn't working for me. I am aware I can use the Style Singleton approach but that means I need to use the style variables in each QML document I make. It would be nicer to just change it globally something like the above if its possible.

    Also: Certain configuration settings are not working. For example, the palette changes dont work but font changes do. Any idea why?

    [Controls]
    Style=Material
    
    [Material]
    Theme=Dark ; These changes work
    Accent=Red
    Palette.Base=Red  ; These changes are not applied/shown?
    Palette.Text=Blue
    
    ; These changes are applied/shown
    [Material\Font]
    Family=Open Sans
    PixelSize=20
    
    ; These changes are not applied/shown?
    [Material\Palette]
    Base=#000000
    Text=#ffffff
    
    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