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. [SOLVED] how to dynamic assign a value to qml item's property transform
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] how to dynamic assign a value to qml item's property transform

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.1k 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.
  • O Offline
    O Offline
    onlypass8
    wrote on last edited by
    #1

    the transform property in item is read-only, i cannot change this value while the program is running. Is there any method to modify it.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      You can modify only properties of Rotation, Scale and Translate objects. For example, if you got:

      @
      Image {
      id: img
      source: "pics/qt.png"
      transform: Rotation { id: rot; origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
      }
      @

      it is possible to change it like that:

      @
      rot.origin.x = 40
      @

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • O Offline
        O Offline
        onlypass8
        wrote on last edited by
        #3

        thanks very much, your answer can help me to resolve my problem

        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