Hi everyone,
can i use MultipointtouchArea inside a target like a PinchArea ? When i used the code below on a touch screen on win8 there is no problem. But on linux board with TUIO interface like QTuio i have some troubles.
I use a delta because the target “rect” and “rect2” move so the toucharea moves too.
Is the design good or not ? Why this code works on windows and not under linux ?
Thanks all to give me some answers.
My code :
Rectangle {
id: rect
width: 30; height: 30
color: "yellow"
MultiPointTouchArea {
anchors.fill: rect
onTouchUpdated: {
var pt = touchPoints[0];
if (pt === undefined){
return
}
var delta = Qt.vector2d(pt.x - pt.previousX, pt.y - pt.previousY);
rect.x = delta.x
rect.y = delta.y
}
}
}
Rectangle {
id: rect2
width: 30; height: 30
color: "green"
x: 300
MultiPointTouchArea {
anchors.fill: rect2
onTouchUpdated: {
var pt = touchPoints[0];
if (pt === undefined){
return
}
var delta = Qt.vector2d(pt.x - pt.previousX, pt.y - pt.previousY);
rect2.x += delta.x
rect2.y += delta.y
}
}
}
↧