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. SequentialAnimation blinks in Qt 5.14 works as expected in Qt 5.13
Forum Updated to NodeBB v4.3 + New Features

SequentialAnimation blinks in Qt 5.14 works as expected in Qt 5.13

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qml
3 Posts 2 Posters 584 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.
  • P Offline
    P Offline
    plover
    wrote on last edited by plover
    #1

    Here is a small example code of a simple sequence animation, on mouse click a red box fades in, stays for almost a second and fades out.
    Q5.13.gif

    The gif above shows what happens when compiled with Qt 5.13, an expected behaviour.

    In Qt 5.14 the box blinks before it disappears as shown in the gif below. Is this a bug ?

    Qt5.14.gif

    The code run is as the following:

    import QtQuick 2.13
    
    Item {
    
        width: 360
        height: 340
    
    
        Rectangle {
            id: rootId
    
            visible: animationId.running
            height: 60
            width: 60
            color: "red"
    
            opacity: 0.0
            anchors {
                top: parent.top
                topMargin: 76
                horizontalCenter: parent.horizontalCenter
            }
    
            SequentialAnimation {
                    id: animationId
                    alwaysRunToEnd: false
                    PropertyAnimation {
                        target: rootId
                        property: "opacity"
                        to: "1.0"
                        duration: 300
                    }
                    PropertyAnimation {
                        target: rootId
                        property: "opacity"
                        to: "1.0"
                        duration: 800
                    }
                    PropertyAnimation {
                        target: rootId
                        property: "opacity"
                        to: "0.0"
                        duration: 600
                    }
                }
        }
    
    
        MouseArea 
        {
            anchors.fill : parent 
    
            onClicked: animationId.restart()
        }
    
    }
    
    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      It's a change of behaviour but your code is weird.

      You use string value to assign a real number value.
      Your second PropertyAnimation repeats the first one, it seems you added it just as a pause.

      Your animation wrote like this is clearer and works as intendend:

      SequentialAnimation {
          id: animationId
          alwaysRunToEnd: false
          PropertyAnimation {
              target: rootId
              property: "opacity"
              to: 1
              duration: 300
          }
          PauseAnimation {
              duration: 800
          }
          PropertyAnimation {
              target: rootId
              property: "opacity"
              to: 0
              duration: 600
          }
      }
      
      1 Reply Last reply
      3
      • P Offline
        P Offline
        plover
        wrote on last edited by
        #3

        @GrecKo said in SequentialAnimation blinks in Qt 5.14 works as expected in Qt 5.13:

        SequentialAnimation {
        id: animationId
        alwaysRunToEnd: false
        PropertyAnimation {
        target: rootId
        property: "opacity"
        to: 1
        duration: 300
        }
        PauseAnimation {
        duration: 800
        }
        PropertyAnimation {
        target: rootId
        property: "opacity"
        to: 0
        duration: 600
        }
        }

        Thanks, that solves the issue in qt 5.14.

        Not sure why the former method works in Qt 5.13, but something must have changed between versions.

        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