Dynamic attached Behavior
Unsolved
QML and Qt Quick
-
Hi,
Is it possible to attach a Behavior object to a QML item dynamically?
For example, take out the "Behavior on width" from the code, and assign another "Behavior" after construction by code?
import QtQuick 2.0 Rectangle { id: rect width: 100; height: 100 color: "red" Behavior on width { NumberAnimation { duration: 1000 } } MouseArea { anchors.fill: parent onClicked: rect.width = 50 } }