Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Disable Delegate's MouseArea until ViewTransitions have finished

    QML and Qt Quick
    2
    4
    693
    Loading More Posts
    • 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.
    • Q
      qwasder last edited by

      Hi all,

      I have a ListView that plays "add-" and "displaced-" transitions when adding an item.

      I want the item-delegate's MouseArea to be disabled until all transitions for this add have finished, to avoid complications.
      What would be the best way to do this?

      1 Reply Last reply Reply Quote 0
      • p3c0
        p3c0 Moderators last edited by

        Hi,

        One way would be to enable/disable the MouseArea in onRunningChanged handler or bind that Transition's running to that of MouseArea's enabled.

        157

        1 Reply Last reply Reply Quote 0
        • Q
          qwasder last edited by

          [quote author="p3c0" date="1425104278"]Hi,

          One way would be to enable/disable the MouseArea in onRunningChanged handler or bind that Transition's running to that of MouseArea's enabled.[/quote]
          Can I even access a delegate's properties from the ListView at that time?

          1 Reply Last reply Reply Quote 0
          • p3c0
            p3c0 Moderators last edited by

            No need for that just bind the runnig property.
            @
            ListView {
            ...
            delegate: Rectangle {
            ...
            MouseArea {
            anchors.fill: parent
            enabled: !myTrans.running
            }
            }
            ...
            add: Transition {
            id: myTrans
            NumberAnimation { properties: "y"; from: 100; duration:5000 }
            }
            }
            @

            157

            1 Reply Last reply Reply Quote 0
            • First post
              Last post