Restore Rectangle color



  • This post is deleted!


  • I'd just use an extra color variable to control the "normal color" of the rectangle. That way it is saved automatically... Code would look like this:

    Rectangle {
       property bool alert: false
       normalColor: "black"
       color: alert ? "red" : normalColor
       Text { text: "hello" }
    }
    

    Then you can just change normalColor as you need and it will auto update.


Log in to reply