我试图让MultiPointTouchArea工作...我发现QT真正简单的例子:QT MultiPointTouchArea不起作用
http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-multipointtoucharea.html
import QtQuick 2.0
Rectangle {
width: 400; height: 400
MultiPointTouchArea {
anchors.fill: parent
touchPoints: [
TouchPoint { id: point1 },
TouchPoint { id: point2 }
]
}
Rectangle {
width: 30; height: 30
color: "green"
x: point1.x
y: point1.y
}
Rectangle {
width: 30; height: 30
color: "yellow"
x: point2.x
y: point2.y
}
}
但是,如果我移动鼠标,什么也没有发生...位置一直是x = 0,y = 0但文档告诉我:“Item :: enabled属性用于启用和禁用触摸处理。禁用时,触摸区域对于鼠标/触摸变得透明事件“。因此,MultiPointTouchArea没有被禁用,所以它应该工作?或者我错了?
谢谢你的答案:) – mkl