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. Qt quick Transform ...

Qt quick Transform ...

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

    Hi;
    I would like to manipulate Transform and Scale of an image , using IDs .
    here is my code. my IDs are "imgScaleID" and "transID" :

                Image{
                    id : imageId
                    anchors.centerIn: parent
    
    // My first transform:
                    transform: Scale {
                        id: imgScaleID
                           ...
                    }
    
    // My second transform:
                    transform: Translate {
                        id: transID
                           ...
                    }
                }
    //--------------------------------------------------------------
                MouseArea{
                    onWheel: {
                        imgScaleID.xScale += wheel.angleDelta.y/1200;
                        imgScaleID.yScale += wheel.angleDelta.y/1200;
    
                        transID.x += wheel.angleDelta.y/12;
                        transID.y  += wheel.angleDelta.y/12;
    
                    }
                        ...
                    }
                }
    
    
    

    The problem is , the compiler doesn't accept my second " transform:.. " code...!
    Any idea...?

    Thanks.
    MSD.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JordanHarris
      wrote on last edited by JordanHarris
      #2

      You can't bind to a property twice I guess. If you look at the docs, you'll see that it holds a list<Transform>.

      Item {
          transform: [
              Scale {
                  //...
              },
              Translate {
                  //...
              }
          ]
      }
      
      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