Skip to content

Commit e21f160

Browse files
committed
Enable touch for the map canvas on windows
1 parent 5e29777 commit e21f160

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/gui/qgsmapcanvas.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
129129
connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ),
130130
this, SLOT( writeProject( QDomDocument & ) ) );
131131
mMap->resize( size() );
132+
133+
#ifdef Q_OS_WIN
134+
// Enable touch event on Windows.
135+
// Qt on Windows needs to be told it can take touch events or else it ignores them.
136+
grabGesture(Qt::PinchGesture);
137+
viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
138+
#endif
132139
} // QgsMapCanvas ctor
133140

134141

0 commit comments

Comments
 (0)