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 can I change the color of a button on clicked?
Qt 6.11 is out! See what's new in the release blog

How can I change the color of a button on clicked?

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

    I saw a video where you need to create a ui.qml file for each rectangle and set a binding. I have 25 button is there an easier way to do this?

    property alias rectangleColor: rectangle.color

    raven-worxR 1 Reply Last reply
    0
    • M Marianagb

      I saw a video where you need to create a ui.qml file for each rectangle and set a binding. I have 25 button is there an easier way to do this?

      property alias rectangleColor: rectangle.color

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Marianagb
      a vague answer for a very generic question:
      Use a Component and a Repeater.

      --- 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
      3

      • Login

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