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 implement custon control to play well with any style?

How to implement custon control to play well with any style?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
stylequick2qml
3 Posts 2 Posters 469 Views
  • 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.
  • T Offline
    T Offline
    travnick
    wrote on 1 Mar 2020, 13:26 last edited by
    #1

    Hi

    I'm creating a custom qml component - simple qml file.
    How do I access current style properties, to play well with it?

    A user may use Material/Whatever Light/Dark/other style and I want to match the style, so my component will look properly (at least colors are not completely mixed up)

    Is there any way to do that?
    I've tried to use ApplicationWindow.window.palette, but it does not contain current style palette - there is almost white color (#eff0f1) for palette.window, while using Material Dark style.

    I may use a Material or other style attached property, but it binds my component to only one style.

    R 1 Reply Last reply 1 Mar 2020, 17:56
    0
    • T travnick
      1 Mar 2020, 13:26

      Hi

      I'm creating a custom qml component - simple qml file.
      How do I access current style properties, to play well with it?

      A user may use Material/Whatever Light/Dark/other style and I want to match the style, so my component will look properly (at least colors are not completely mixed up)

      Is there any way to do that?
      I've tried to use ApplicationWindow.window.palette, but it does not contain current style palette - there is almost white color (#eff0f1) for palette.window, while using Material Dark style.

      I may use a Material or other style attached property, but it binds my component to only one style.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 1 Mar 2020, 17:56 last edited by
      #2

      @travnick
      the Material style also has an attached property

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • T Offline
        T Offline
        travnick
        wrote on 2 Mar 2020, 09:10 last edited by
        #3

        As I mentioned, I would like to play with any style, so I guess I'm not able to hardcode use of Material style.

        1 Reply Last reply
        0

        1/3

        1 Mar 2020, 13:26

        • Login

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