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 does QQuickItem do with Animation? very amazing!
Forum Updated to NodeBB v4.3 + New Features

How does QQuickItem do with Animation? very amazing!

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.4k 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.
  • J Offline
    J Offline
    jiangcaiyang
    wrote on last edited by
    #1

    The Item ( which is QuickItem in C++ ) support Animation, how does my "ColorCube" ( derived from QObject and registered into QML ) support Animation? the simple code does not apply Animation, in other word, the color cube does not rotate.

    @
    ColorCube
    {
    id: cube
    objectName: "The ColorCube"
    vertexShaderFile: "../shader/ColorCube.vsh"
    fragmentShaderFile: "../shader/ColorCube.fsh"

            ParallelAnimation
            {
                running: true
                NumberAnimation
                {
                    target: cube
                    property: "rotateAngle"
                    from: 0
                    to: 360
                    duration: 5000
                }
        
                Vector3dAnimation
                {
                    target: cube
                    property: "axis"
                    from: Qt.vector3d( 0, 1, 0 )
                    to: Qt.vector3d( 1, 0, 0 )
                    duration: 5000
                }
                loops: Animation.Infinite
            }
        }
    

    @

    1 Reply Last reply
    0
    • slettaS Offline
      slettaS Offline
      sletta
      wrote on last edited by
      #2

      You need to post a complete example including the ColorCube if we're going to help you.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bootchk
        wrote on last edited by
        #3

        Sletta: you mean, an example of some outer code that instantiates a ColorCube? So that others could test the code without having to write the outer code themselves? (I'm not criticizing, just trying to understand and facilitate the discussion.)

        Also, I don't understand why the OP mentions registering ColorCube, as if it were defined in C++, but isn't the posted code the definition of ColorCube in QML?

        1 Reply Last reply
        0
        • slettaS Offline
          slettaS Offline
          sletta
          wrote on last edited by
          #4

          The posted example is incomplete, so we have no idea what the properties "rotateAngle" and "axis" affect. Nor do we know what the ColorCube is supposed to do with those. Hence, a complete example needs to be posted before anybody can comment on it.

          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