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. Quick Controls 2 styles extension
Forum Updated to NodeBB v4.3 + New Features

Quick Controls 2 styles extension

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

    For example, consider Universal style.
    This is good, but not enough.
    Now, I have several problems with customization of my app:

    1. Ligth and dark themes looks good, but I want to change more colors than just accent, foreground and background. I see in source code that now in universal style exist 18 different colors, but they read only. It mean that in code I can use them in read only context, and next code:
    Universal.altHighColor: Universal.Red
    

    will return next error:

    Invalid property assignment: "altHighColor" is a read-only property
    
    1. Ok, may be I can extend universal themes and add own, where I will can redefine read only colors? No. I don't see real interfaces for this even in private classes.
    2. Once way that I see now is a copy paste Universal style, change colors to my needs and create own style, using private qt classes. Only for changing predefined colors.

    Really, styling in quick controls 2 looks very good as idea, but implementation now is very limited. May be I just don't understand something? How I can change predefined colors or add new theme for universal style?

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by jpnurmi
      #2

      It is all about the balance between performance and flexibility. The more configurable style attributes we add, the more information every single style node needs to store and inherit/promote, instead of being able to pick values straight from a shared table of pre-defined constants. The implementation is "very limited", as you say, by design. It is a deliberate choice to support a level of customization that keeps the performance optimal yet satisfies 90% of the users. For the 10% that need to go beyond that level, custom delegates, that allow you to do pretty much anything you want, is the recommended way to go.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Milovidov
        wrote on last edited by Milovidov
        #3

        Ok, may be this have sense, but what I can do now, if I satisfied with universal controls but want just to change colors? Is exist way excluding copy pasting universal style?

        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