Unsolved QQuickWidget touch
-
quickwidget->setAttribute(Qt::WA_AcceptTouchEvents)
does setting this attribute still works for touch events?
[Qt version 5.13] -
@joantoh said in QQuickWidget touch:
does setting this attribute still works for touch events?
Did you try?
-
@jsulm yes i did. it doesn't work.
main.cpp
QQuickWidget *content = new QQuickWidget(QUrl("qrc:/myPopup.qml"));
content->setAttribute(Qt::WA_TranslucentBackground);
content->setClearColor(Qt::transparent);
content->setAttribute(Qt::WA_AcceptTouchEvents);
scene.addWidget(content);myPopup.qml
import QtQuick 2.13
import QtQuick.Controls 2.13Rectangle {
id:itemParent
width: 90; height: 90
color: "red"MultiPointTouchArea {
anchors.fill: parent
minimumTouchPoints: 1
maximumTouchPoints: 2touchPoints: [ TouchPoint { id: touch1; objectName: "touch 1"; } ] onPressed: { console.log(touch1.objectName, "pressed:", touch1.pressed, touch1.x, touch1.y); } onReleased: { console.log(touch1.objectName, "onReleased:", touch1.pressed, touch1.x, touch1.y); } onTouchUpdated: { console.log(touch1.objectName, "onTouchUpdated:", touch1.pressed, touch1.x, touch1.y); }
}
} -
-
@jsulm said in QQuickWidget touch:
t is scene here?
QGraphicsScene scene;
scene.setSceneRect(0, 0, 1920, 1080);QGraphicsView view(&scene);
view.show();