git-svn-id: svn://db.shs.com.ru/libs@521 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-04-08 15:21:11 +00:00
parent 4bce643660
commit 6a6371bb11

View File

@@ -155,7 +155,7 @@ bool Graphic::eventFilter(QObject * o, QEvent * e) {
if (o == canvas) {
switch (e->type()) {
case QEvent::Gesture:
if (!gestures) break;
if (!navigation || !gestures) break;
foreach (QGesture * g, ((QGestureEvent*)e)->gestures())
procGesture(g);
break;
@@ -164,11 +164,11 @@ bool Graphic::eventFilter(QObject * o, QEvent * e) {
leaveFullscreen();
break;
case QEvent::TouchBegin:
if (!gestures) break;
if (!navigation || !gestures) break;
need_mouse_pan = true;
break;
case QEvent::TouchUpdate: {
if (!gestures) break;
if (!navigation || !gestures) break;
QList<QTouchEvent::TouchPoint> tpl = ((QTouchEvent*)e)->touchPoints();
if (tpl.size() == 2) {
need_mouse_pan = false;
@@ -193,7 +193,7 @@ void Graphic::prepareCanvas(QWidget * w) {
connect(w, SIGNAL(keyPressEvent(QKeyEvent * )), this, SLOT(canvasKeyPressEvent(QKeyEvent * )));
//w->grabGesture(Qt::TapGesture);
w->grabGesture(Qt::TapAndHoldGesture);
//w->grabGesture(Qt::PanGesture);
w->grabGesture(Qt::PanGesture);
w->grabGesture(Qt::PinchGesture);
w->setMouseTracking(true);
w->installEventFilter(this);