jj200602 |
2018-01-02 22:40 |
import QtQuick 2.0 import QtQuick.Controls 1.3 Rectangle { id: container property int counter: 1 width: 600; height: 600 Timer{ interval: 10000 repeat: true running: true onTriggered: container.counter++; } Repeater{ model: container.counter Rectangle { id: iddragblock width: 50; height: 50 y: 54 * index x: 54 * index color: "red" Drag.active: idmousearea.drag.active Drag.dragType: Drag.Automatic MouseArea { id:idmousearea anchors.fill: parent drag.target: iddragblock } } } } 试验代码如上。只要使用了Automatic, 触发Drag后保持按着不动,等源Item被释放后,松开鼠标就会出错。
|
|