Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPropertyAnimation and "visible"
Forum Updated to NodeBB v4.3 + New Features

QPropertyAnimation and "visible"

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 2.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.
  • B Offline
    B Offline
    Bjorn.Gurnett
    wrote on last edited by
    #1

    Hello

    in qml it is possible to animate the items visible property. I'm trying the same thing in c++ and it doesn't seem to be working. Is this a known issue or am I missing something. The reason for the attempt is that I'm setting up a number of parallel and sequential animations and during some of these steps I need to set visible false on certain items (not opacity 0). Using Qt 4.8.6

    thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show how you do it currently ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bjorn.Gurnett
        wrote on last edited by Bjorn.Gurnett
        #3

        This was just a little test code. Missed that I was using NumberAnimation in the qml.

        Transition {from: "State1"; to: "State2";
        SequentialAnimation
        {
                 ParallelAnimation
                 {
                      NumberAnimation { target: wnd1; property: "x"; from: 0; to: root.width; duration: 250 }
                      NumberAnimation { target: wnd2; property: "x"; from: -root.width; to: 0; duration: 250 }
                 }
                  NumberAnimation { target: wnd1 ; property: "visible"; from: 1; to: 0; duration: 0 }
         }
        

        Is there an easy solution to this, or will I have to derive my own from http://doc.qt.io/qt-4.8/qvariantanimation.html#details

        Thanks

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you check with the PropertyAnimation ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bjorn.Gurnett
            wrote on last edited by
            #5

            Yes Qpropertyanimation is what I'm trying in c++, but it does not work. Note This needs to be done in c++ and not qml. The qml code i posted does work. It's the c++ equivalent that doesn't

            kind regards

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Then sorry I somehow misunderstood what you are trying to do.

              What do you want to animate exactly in C++ ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Bjorn.Gurnett
                wrote on last edited by
                #7

                It's a menu system that slides in and out.

                A given qml file contains several sub pages (each one is an Item). The c++ component keeps track of pages that should be shown based on available hardware and access levels and ordering. To minimise work required in qml we want to have as much as possible in the c++ component, including animations, to allow for easy "drop-in" of the component.

                Thanks

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Sounds like you are trying to split a bit too much the responsibilities. If you have the same animation for all your pages, why not have a base page that contains it and all the other be subclass of that base page.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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