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. How to customize app-wide theme

How to customize app-wide theme

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 371 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.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by
    #1

    As a QStyle and CSS thinker, I am having trouble understanding how to manage app-wide theme settings in Qml. It appears that there is a list of available themes, but no canonical guide for how to, for example, change the normal text size or window color or table element height for every element in my app?

    It seems strange that you would hard-code a particular theme into an app because then you couldn't swap the theme out and have it propagate across the app. For example with the following example from the Qt docs:

    Button {
        text: qsTr("Button")
        highlighted: true
        Universal.accent: Universal.Orange
    }
    

    Do you program all of your items and delegates to pull from some global variables, and then set the globals to specific theme attributes?

    Is it typical practices to simply hard-code a single look and feel across devices?

    Am I not thinking about this correctly? What am I missing?

    Cheers,
    -Patrick

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on last edited by
      #2

      You should set theme to ApplicationWindow, all child controls inherits theme from parent items.

      P 1 Reply Last reply
      0
      • IntruderExcluderI IntruderExcluder

        You should set theme to ApplicationWindow, all child controls inherits theme from parent items.

        P Offline
        P Offline
        patrickkidd
        wrote on last edited by
        #3

        @IntruderExcluder How would this work if this is a QWidget app that only uses QQuickWidget as sub-views, e.g. for property sheets?

        https://alaskafamilysystems.com/

        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