[Interest] QML Drag Type `dragStarted` and `dragFinished` signals
Sina Dogru
sinadooru at gmail.com
Wed Feb 24 09:31:33 CET 2016
Hello,
As documentation of Drag QML Type says on `active
<http://doc.qt.io/qt-5/qml-qtquick-drag.html#active-attached-prop>`
property,
Binding this property to the active property of MouseArea::drag
> <http://doc.qt.io/qt-5/qml-qtquick-mousearea.html#drag-prop> will cause
> startDrag <http://doc.qt.io/qt-5/qml-qtquick-drag.html#startDrag-method>
> to be called when the user starts dragging.
And same documentation also says on `dragStarted
<http://doc.qt.io/qt-5/qml-qtquick-drag.html#dragStarted-signal>` signal,
This signal is emitted when a drag is started with the startDrag()
> <http://doc.qt.io/qt-5/qml-qtquick-drag.html#startDrag-method> method or
> when it is started automatically using the dragType
> <http://doc.qt.io/qt-5/qml-qtquick-drag.html#dragType-attached-prop>
> property.
>
So according to those, what I do understand is,
Rectangle {
id: rect
width: 20; height: 20
color: "red"
Drag.active: mouseArea.drag.active
Drag.onDragStarted: console.log("dragStarted");
MouseArea {
id: mouseArea
anchors.fill: parent
drag.target: parent
onReleased: parent.Drag.drop();
}
}
the code above should write "dragStarted" on the console when I move the
rect, but this does not happen.
Does anyone know the right way?
Thank you,
Cavit Sina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160224/bc5e93d3/attachment.html>
More information about the Interest
mailing list