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. left-hand side of assignment operator is not an lvalue

left-hand side of assignment operator is not an lvalue

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 1.8k 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.
  • D Offline
    D Offline
    Designer23
    wrote on last edited by
    #1

    hello,
    I faced an error saying: Error: left-hand side of assignment operator is not an lvalue with QML

    property var play: 0
        Button{
            id:play
            x: 212
            y: 385
            width: 39
            height: 40
            Image{
                id:img
                anchors.topMargin: 6
                anchors.fill: parent
                source: "qrc:/images/play.png"
            }
            onClicked: {
                play++
                if(play===1){
                    img.source="qrc:/images/pause.png"
                }
            }
        }
    

    How can I solve it.
    thanks

    ODБOïO 1 Reply Last reply
    0
    • D Designer23

      hello,
      I faced an error saying: Error: left-hand side of assignment operator is not an lvalue with QML

      property var play: 0
          Button{
              id:play
              x: 212
              y: 385
              width: 39
              height: 40
              Image{
                  id:img
                  anchors.topMargin: 6
                  anchors.fill: parent
                  source: "qrc:/images/play.png"
              }
              onClicked: {
                  play++
                  if(play===1){
                      img.source="qrc:/images/pause.png"
                  }
              }
          }
      

      How can I solve it.
      thanks

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi
      You use "play" as property name and button id

      1 Reply Last reply
      2

      • Login

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