mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
fix app test + clean up
This commit is contained in:
parent
acca2f1b68
commit
2b6195c7e7
@ -30,9 +30,8 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
QgsMapToolsDigitizingTechniqueManager::QgsMapToolsDigitizingTechniqueManager( QgsAppMapTools *mapTools, QObject *parent )
|
QgsMapToolsDigitizingTechniqueManager::QgsMapToolsDigitizingTechniqueManager( QObject *parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, mMapTools( mapTools )
|
|
||||||
{
|
{
|
||||||
mTechniqueActions.insert( QgsMapToolCapture::CaptureTechnique::StraightSegments, QgisApp::instance()->mActionDigitizeWithSegment );
|
mTechniqueActions.insert( QgsMapToolCapture::CaptureTechnique::StraightSegments, QgisApp::instance()->mActionDigitizeWithSegment );
|
||||||
mTechniqueActions.insert( QgsMapToolCapture::CaptureTechnique::CircularString, QgisApp::instance()->mActionDigitizeWithCurve );
|
mTechniqueActions.insert( QgsMapToolCapture::CaptureTechnique::CircularString, QgisApp::instance()->mActionDigitizeWithCurve );
|
||||||
@ -45,7 +44,7 @@ QgsMapToolsDigitizingTechniqueManager::QgsMapToolsDigitizingTechniqueManager( Qg
|
|||||||
|
|
||||||
void QgsMapToolsDigitizingTechniqueManager::setupCanvasTools()
|
void QgsMapToolsDigitizingTechniqueManager::setupCanvasTools()
|
||||||
{
|
{
|
||||||
const QList< QgsMapToolCapture * > captureTools = mMapTools->captureTools();
|
const QList< QgsMapToolCapture * > captureTools = QgisApp::instance()->captureTools();
|
||||||
for ( QgsMapToolCapture *tool : captureTools )
|
for ( QgsMapToolCapture *tool : captureTools )
|
||||||
{
|
{
|
||||||
connect( tool->action(), &QAction::toggled, this, [this, tool]( bool checked ) { enableDigitizingTechniqueActions( checked, tool->action() ); } );
|
connect( tool->action(), &QAction::toggled, this, [this, tool]( bool checked ) { enableDigitizingTechniqueActions( checked, tool->action() ); } );
|
||||||
|
|||||||
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
|
|
||||||
class QgsSpinBox;
|
class QgsSpinBox;
|
||||||
class QgsAppMapTools;
|
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
@ -58,7 +57,7 @@ class APP_EXPORT QgsMapToolsDigitizingTechniqueManager : public QObject
|
|||||||
static const inline QgsSettingsEntryString settingMapToolShapeDefaultForShape = QgsSettingsEntryString( QStringLiteral( "shape-map-tools/%1/default" ), QgsSettings::App, QString(), QObject::tr( "Default map tool for given shape category" ) ) SIP_SKIP;
|
static const inline QgsSettingsEntryString settingMapToolShapeDefaultForShape = QgsSettingsEntryString( QStringLiteral( "shape-map-tools/%1/default" ), QgsSettings::App, QString(), QObject::tr( "Default map tool for given shape category" ) ) SIP_SKIP;
|
||||||
static const inline QgsSettingsEntryString settingMapToolShapeCurrent = QgsSettingsEntryString( QStringLiteral( "shape-map-tools/current" ), QgsSettings::App, QString(), QObject::tr( "Current shape map tool" ) ) SIP_SKIP;
|
static const inline QgsSettingsEntryString settingMapToolShapeCurrent = QgsSettingsEntryString( QStringLiteral( "shape-map-tools/current" ), QgsSettings::App, QString(), QObject::tr( "Current shape map tool" ) ) SIP_SKIP;
|
||||||
|
|
||||||
QgsMapToolsDigitizingTechniqueManager( QgsAppMapTools *mapTools, QObject *parent );
|
QgsMapToolsDigitizingTechniqueManager( QObject *parent );
|
||||||
~QgsMapToolsDigitizingTechniqueManager();
|
~QgsMapToolsDigitizingTechniqueManager();
|
||||||
void setupToolBars();
|
void setupToolBars();
|
||||||
void setupCanvasTools();
|
void setupCanvasTools();
|
||||||
@ -72,8 +71,6 @@ class APP_EXPORT QgsMapToolsDigitizingTechniqueManager : public QObject
|
|||||||
void setShapeTool( const QString &shapeToolId );
|
void setShapeTool( const QString &shapeToolId );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsAppMapTools *mMapTools = nullptr;
|
|
||||||
|
|
||||||
QMap<QgsMapToolCapture::CaptureTechnique, QAction *> mTechniqueActions;
|
QMap<QgsMapToolCapture::CaptureTechnique, QAction *> mTechniqueActions;
|
||||||
QHash<QString, QAction *> mShapeActions;
|
QHash<QString, QAction *> mShapeActions;
|
||||||
QMap<QgsMapToolShapeAbstract::ShapeCategory, QToolButton *> mShapeCategoryButtons;
|
QMap<QgsMapToolShapeAbstract::ShapeCategory, QToolButton *> mShapeCategoryButtons;
|
||||||
|
|||||||
@ -1193,7 +1193,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipBadLayers
|
|||||||
|
|
||||||
// create map tools
|
// create map tools
|
||||||
mMapTools = std::make_unique< QgsAppMapTools >( mMapCanvas, mAdvancedDigitizingDockWidget );
|
mMapTools = std::make_unique< QgsAppMapTools >( mMapCanvas, mAdvancedDigitizingDockWidget );
|
||||||
mDigitizingTechniqueManager = new QgsMapToolsDigitizingTechniqueManager( mMapTools.get(), this );
|
mDigitizingTechniqueManager = new QgsMapToolsDigitizingTechniqueManager( this );
|
||||||
|
|
||||||
QgsGui::mapToolShapeRegistry()->addMapTool( new QgsMapToolShapeCircularStringRadiusMetadata() );
|
QgsGui::mapToolShapeRegistry()->addMapTool( new QgsMapToolShapeCircularStringRadiusMetadata() );
|
||||||
QgsGui::mapToolShapeRegistry()->addMapTool( new QgsMapToolShapeCircle2PointsMetadata() );
|
QgsGui::mapToolShapeRegistry()->addMapTool( new QgsMapToolShapeCircle2PointsMetadata() );
|
||||||
@ -1884,6 +1884,8 @@ QgisApp::QgisApp()
|
|||||||
mPanelMenu = new QMenu( this );
|
mPanelMenu = new QMenu( this );
|
||||||
mProgressBar = new QProgressBar( this );
|
mProgressBar = new QProgressBar( this );
|
||||||
mStatusBar = new QgsStatusBar( this );
|
mStatusBar = new QgsStatusBar( this );
|
||||||
|
mMapTools = std::make_unique< QgsAppMapTools >( mMapCanvas, mAdvancedDigitizingDockWidget );
|
||||||
|
mDigitizingTechniqueManager = new QgsMapToolsDigitizingTechniqueManager( this );
|
||||||
|
|
||||||
mBearingNumericFormat.reset( QgsLocalDefaultSettings::bearingFormat() );
|
mBearingNumericFormat.reset( QgsLocalDefaultSettings::bearingFormat() );
|
||||||
// More tests may need more members to be initialized
|
// More tests may need more members to be initialized
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user