mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
Remove unnecessary touch device check
This commit is contained in:
parent
60e576e11f
commit
f5af506323
@ -315,15 +315,12 @@ void QgsPlotCanvas::wheelZoom( QWheelEvent * )
|
||||
|
||||
bool QgsPlotCanvas::event( QEvent *e )
|
||||
{
|
||||
if ( !QTouchDevice::devices().empty() )
|
||||
if ( e->type() == QEvent::Gesture )
|
||||
{
|
||||
if ( e->type() == QEvent::Gesture )
|
||||
// call handler of current map tool
|
||||
if ( mTool )
|
||||
{
|
||||
// call handler of current map tool
|
||||
if ( mTool )
|
||||
{
|
||||
return mTool->gestureEvent( static_cast<QGestureEvent *>( e ) );
|
||||
}
|
||||
return mTool->gestureEvent( static_cast<QGestureEvent *>( e ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -77,8 +77,6 @@ email : sherman at mrcc.com
|
||||
#include "qgsreferencedgeometry.h"
|
||||
#include "qgsprojectviewsettings.h"
|
||||
#include "qgsmaplayertemporalproperties.h"
|
||||
#include "qgsrasterlayertemporalproperties.h"
|
||||
#include "qgsvectorlayertemporalproperties.h"
|
||||
#include "qgstemporalcontroller.h"
|
||||
#include "qgsruntimeprofiler.h"
|
||||
#include "qgsprojectionselectiondialog.h"
|
||||
@ -3317,23 +3315,20 @@ void QgsMapCanvas::mapToolDestroyed()
|
||||
|
||||
bool QgsMapCanvas::event( QEvent *e )
|
||||
{
|
||||
if ( !QTouchDevice::devices().empty() )
|
||||
if ( e->type() == QEvent::Gesture )
|
||||
{
|
||||
if ( e->type() == QEvent::Gesture )
|
||||
if ( QTapAndHoldGesture *tapAndHoldGesture = qobject_cast< QTapAndHoldGesture * >( static_cast<QGestureEvent *>( e )->gesture( Qt::TapAndHoldGesture ) ) )
|
||||
{
|
||||
if ( QTapAndHoldGesture *tapAndHoldGesture = qobject_cast< QTapAndHoldGesture * >( static_cast<QGestureEvent *>( e )->gesture( Qt::TapAndHoldGesture ) ) )
|
||||
{
|
||||
QPointF pos = tapAndHoldGesture->position();
|
||||
pos = mapFromGlobal( QPoint( pos.x(), pos.y() ) );
|
||||
QgsPointXY mapPoint = getCoordinateTransform()->toMapCoordinates( pos.x(), pos.y() );
|
||||
emit tapAndHoldGestureOccurred( mapPoint, tapAndHoldGesture );
|
||||
}
|
||||
QPointF pos = tapAndHoldGesture->position();
|
||||
pos = mapFromGlobal( QPoint( pos.x(), pos.y() ) );
|
||||
QgsPointXY mapPoint = getCoordinateTransform()->toMapCoordinates( pos.x(), pos.y() );
|
||||
emit tapAndHoldGestureOccurred( mapPoint, tapAndHoldGesture );
|
||||
}
|
||||
|
||||
// call handler of current map tool
|
||||
if ( mMapTool )
|
||||
{
|
||||
return mMapTool->gestureEvent( static_cast<QGestureEvent *>( e ) );
|
||||
}
|
||||
// call handler of current map tool
|
||||
if ( mMapTool )
|
||||
{
|
||||
return mMapTool->gestureEvent( static_cast<QGestureEvent *>( e ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
#include "qgsmaptopixel.h"
|
||||
#include "qgsmapmouseevent.h"
|
||||
#include "qgsproject.h"
|
||||
#include "qgslogger.h"
|
||||
|
||||
|
||||
QgsMapToolPan::QgsMapToolPan( QgsMapCanvas *canvas )
|
||||
@ -116,7 +115,7 @@ void QgsMapToolPan::canvasReleaseEvent( QgsMapMouseEvent *e )
|
||||
|
||||
void QgsMapToolPan::canvasDoubleClickEvent( QgsMapMouseEvent *e )
|
||||
{
|
||||
if ( !QTouchDevice::devices().isEmpty() && !mPinching )
|
||||
if ( !mPinching )
|
||||
{
|
||||
mCanvas->zoomWithCenter( e->x(), e->y(), true );
|
||||
}
|
||||
@ -124,9 +123,6 @@ void QgsMapToolPan::canvasDoubleClickEvent( QgsMapMouseEvent *e )
|
||||
|
||||
bool QgsMapToolPan::gestureEvent( QGestureEvent *event )
|
||||
{
|
||||
if ( QTouchDevice::devices().isEmpty() )
|
||||
return true; // no touch support
|
||||
|
||||
if ( QGesture *gesture = event->gesture( Qt::PinchGesture ) )
|
||||
{
|
||||
mPinching = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user