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. QML Switch UI : Color property
Forum Updated to NodeBB v4.3 + New Features

QML Switch UI : Color property

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.2k 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
    Prasad_Socionext
    wrote on last edited by
    #1

    How can I change the color of the Switch UI in QML. How to I access the property ?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DavidM29
      wrote on last edited by DavidM29
      #2

      I'm not sure if you are talking about what I think but if you talk about the Switch from Qt quick controls here is an example :

          Switch {
              id: sw
              style: SwitchStyle {
                  groove: Rectangle {
                          implicitWidth: 50
                          implicitHeight: 20
                          radius: 9
                          border.color: "black"
                          border.width: 1
                          color: sw.checked ? "blue" : "white"
                  }
                  handle: Rectangle{
                      implicitWidth: sw.width/2
                      implicitHeight: 20
                      radius: 9
                      border.color: "black"
                      border.width: 1
                  }
              }
           }
      
      

      For more information : SwitchStyle

      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