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 473 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 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.

    raven-worxR 1 Reply Last reply
    0
    • T travnick

      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.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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 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

        • Login

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