Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use a pan tool for map views
  • Loading branch information
nyalldawson committed Mar 13, 2017
1 parent 7b28760 commit dbe54c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/qgsmapcanvasdockwidget.cpp
Expand Up @@ -19,6 +19,7 @@
#include "qgsstatusbarmagnifierwidget.h"
#include "qgsdoublespinbox.h"
#include "qgssettings.h"
#include "qgsmaptoolpan.h"
#include <QMessageBox>
#include <QMenu>
#include <QToolBar>
Expand All @@ -36,6 +37,8 @@ QgsMapCanvasDockWidget::QgsMapCanvasDockWidget( const QString &name, QWidget *pa

setWindowTitle( name );
mMapCanvas = new QgsMapCanvas( this );
mPanTool = new QgsMapToolPan( mMapCanvas );
mMapCanvas->setMapTool( mPanTool );

mMainWidget->setLayout( new QVBoxLayout() );
mMainWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmapcanvasdockwidget.h
Expand Up @@ -20,11 +20,13 @@
#include "qgsdockwidget.h"
#include "qgis_app.h"
#include <QWidgetAction>
#include <memory>

class QgsMapCanvas;
class QgsScaleComboBox;
class QgsDoubleSpinBox;
class QgsStatusBarMagnifierWidget;
class QgsMapToolPan;

/**
* \class QgsMapCanvasDockWidget
Expand Down Expand Up @@ -74,6 +76,7 @@ class APP_EXPORT QgsMapCanvasDockWidget : public QgsDockWidget, private Ui::QgsM
bool mBlockScaleUpdate = false;
bool mBlockRotationUpdate = false;
bool mBlockMagnificationUpdate = false;
QgsMapToolPan *mPanTool = nullptr;
};

/**
Expand Down

0 comments on commit dbe54c0

Please sign in to comment.