@@ -360,10 +360,6 @@ extern "C"
360
360
#include <DbgHelp.h>
361
361
#endif
362
362
363
- #ifdef HAVE_TOUCH
364
- #include "qgsmaptooltouch.h"
365
- #endif
366
-
367
363
class QTreeWidgetItem;
368
364
369
365
/** Set the application title bar text
@@ -1092,14 +1088,11 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
1092
1088
QgsDebugMsg( "Tips are disabled" );
1093
1089
}
1094
1090
1095
- #ifdef HAVE_TOUCH
1096
- //add reacting to long click in touch
1097
- grabGesture( Qt::TapAndHoldGesture );
1098
- #else
1099
- //remove mActionTouch button
1100
- delete mActionTouch;
1101
- mActionTouch = nullptr;
1102
- #endif
1091
+ if ( ! QTouchDevice::devices().isEmpty() )
1092
+ {
1093
+ //add reacting to long click in touch
1094
+ grabGesture( Qt::TapAndHoldGesture );
1095
+ }
1103
1096
1104
1097
// supposedly all actions have been added, now register them to the shortcut manager
1105
1098
QgsShortcutsManager::instance()->registerAllChildren( this );
@@ -1253,9 +1246,6 @@ QgisApp::~QgisApp()
1253
1246
delete mMapTools.mZoomIn;
1254
1247
delete mMapTools.mZoomOut;
1255
1248
delete mMapTools.mPan;
1256
- #ifdef HAVE_TOUCH
1257
- delete mMapTools.mTouch;
1258
- #endif
1259
1249
delete mMapTools.mAddFeature;
1260
1250
delete mMapTools.mAddPart;
1261
1251
delete mMapTools.mAddRing;
@@ -1496,12 +1486,10 @@ bool QgisApp::event( QEvent * event )
1496
1486
openFile( foe->file() );
1497
1487
done = true;
1498
1488
}
1499
- #ifdef HAVE_TOUCH
1500
- else if ( event->type() == QEvent::Gesture )
1489
+ else if ( !QTouchDevice::devices().isEmpty() && event->type() == QEvent::Gesture )
1501
1490
{
1502
1491
done = gestureEvent( static_cast<QGestureEvent*>( event ) );
1503
1492
}
1504
- #endif
1505
1493
else
1506
1494
{
1507
1495
// pass other events to base class
@@ -1639,10 +1627,6 @@ void QgisApp::createActions()
1639
1627
connect( mActionOffsetCurve, SIGNAL( triggered() ), this, SLOT( offsetCurve() ) );
1640
1628
1641
1629
// View Menu Items
1642
-
1643
- #ifdef HAVE_TOUCH
1644
- connect( mActionTouch, SIGNAL( triggered() ), this, SLOT( touch() ) );
1645
- #endif
1646
1630
connect( mActionPan, SIGNAL( triggered() ), this, SLOT( pan() ) );
1647
1631
connect( mActionPanToSelected, SIGNAL( triggered() ), this, SLOT( panToSelected() ) );
1648
1632
connect( mActionZoomIn, SIGNAL( triggered() ), this, SLOT( zoomIn() ) );
@@ -1871,9 +1855,6 @@ void QgisApp::createActionGroups()
1871
1855
//
1872
1856
// Map Tool Group
1873
1857
mMapToolGroup = new QActionGroup( this );
1874
- #ifdef HAVE_TOUCH
1875
- mMapToolGroup->addAction( mActionTouch );
1876
- #endif
1877
1858
mMapToolGroup->addAction( mActionPan );
1878
1859
mMapToolGroup->addAction( mActionZoomIn );
1879
1860
mMapToolGroup->addAction( mActionZoomOut );
@@ -2682,9 +2663,6 @@ void QgisApp::setTheme( const QString& theThemeName )
2682
2663
mActionZoomFullExtent->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomFullExtent.svg" ) ) );
2683
2664
mActionZoomToSelected->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomToSelected.svg" ) ) );
2684
2665
mActionShowRasterCalculator->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionShowRasterCalculator.png" ) ) );
2685
- #ifdef HAVE_TOUCH
2686
- mActionTouch->setIcon( QgsApplication::getThemeIcon( "/mActionTouch.svg" ) );
2687
- #endif
2688
2666
mActionPan->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionPan.svg" ) ) );
2689
2667
mActionPanToSelected->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionPanToSelected.svg" ) ) );
2690
2668
mActionZoomLast->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomLast.svg" ) ) );
@@ -2861,10 +2839,6 @@ void QgisApp::createCanvasTools()
2861
2839
mMapTools.mZoomOut->setAction( mActionZoomOut );
2862
2840
mMapTools.mPan = new QgsMapToolPan( mMapCanvas );
2863
2841
mMapTools.mPan->setAction( mActionPan );
2864
- #ifdef HAVE_TOUCH
2865
- mMapTools.mTouch = new QgsMapToolTouch( mMapCanvas );
2866
- mMapTools.mTouch->setAction( mActionTouch );
2867
- #endif
2868
2842
mMapTools.mIdentify = new QgsMapToolIdentifyAction( mMapCanvas );
2869
2843
mMapTools.mIdentify->setAction( mActionIdentify );
2870
2844
connect( mMapTools.mIdentify, SIGNAL( copyToClipboard( QgsFeatureStore & ) ),
@@ -4591,15 +4565,10 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
4591
4565
}
4592
4566
4593
4567
// set the initial map tool
4594
- #ifndef HAVE_TOUCH
4595
4568
mMapCanvas->setMapTool( mMapTools.mPan );
4596
4569
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this
4597
- #else
4598
- mMapCanvas->setMapTool( mMapTools.mTouch );
4599
- mNonEditMapTool = mMapTools.mTouch; // signals are not yet setup to catch this
4600
- #endif
4601
4570
4602
- } // QgisApp::fileNew(bool thePromptToSaveFlag)
4571
+ }
4603
4572
4604
4573
bool QgisApp::fileNewFromTemplate( const QString& fileName )
4605
4574
{
@@ -5834,13 +5803,6 @@ void QgisApp::pan()
5834
5803
mMapCanvas->setMapTool( mMapTools.mPan );
5835
5804
}
5836
5805
5837
- #ifdef HAVE_TOUCH
5838
- void QgisApp::touch()
5839
- {
5840
- mMapCanvas->setMapTool( mMapTools.mTouch );
5841
- }
5842
- #endif
5843
-
5844
5806
void QgisApp::zoomFull()
5845
5807
{
5846
5808
mMapCanvas->zoomToFullExtent();
@@ -12101,8 +12063,6 @@ void QgisApp::onLayerError( const QString& msg )
12101
12063
mInfoBar->pushCritical( tr( "Layer %1" ).arg( layer->name() ), msg );
12102
12064
}
12103
12065
12104
-
12105
- #ifdef HAVE_TOUCH
12106
12066
bool QgisApp::gestureEvent( QGestureEvent *event )
12107
12067
{
12108
12068
if ( QGesture *tapAndHold = event->gesture( Qt::TapAndHoldGesture ) )
@@ -12125,7 +12085,6 @@ void QgisApp::tapAndHoldTriggered( QTapAndHoldGesture *gesture )
12125
12085
QApplication::postEvent( receiver, new QMouseEvent( QEvent::MouseButtonRelease, receiver->mapFromGlobal( pos ), Qt::RightButton, Qt::RightButton, Qt::NoModifier ) );
12126
12086
}
12127
12087
}
12128
- #endif
12129
12088
12130
12089
#ifdef Q_OS_WIN
12131
12090
LONG WINAPI QgisApp::qgisCrashDump( struct _EXCEPTION_POINTERS *ExceptionInfo )
0 commit comments