Skip to content
Permalink
Browse files

Use a pan tool in the browser canvas preview

  • Loading branch information
nyalldawson committed Feb 17, 2017
1 parent 7c4f879 commit 5c211eac39c50081c1647fed3ff914c26dca3c49
Showing with 9 additions and 0 deletions.
  1. +4 −0 src/browser/qgsbrowser.cpp
  2. +5 −0 src/browser/qgsbrowser.h
@@ -28,6 +28,7 @@
#include "qgslogger.h"
#include "qgsconditionalstyle.h"
#include "qgsproject.h"
#include "qgsmaptoolpan.h"
#include "qgsproviderregistry.h"
#include "qgsvectorlayer.h"
#include "qgsrasterlayer.h"
@@ -54,6 +55,9 @@ QgsBrowser::QgsBrowser( QWidget *parent, Qt::WindowFlags flags )
{
setupUi( this );

mMapToolPan.reset( new QgsMapToolPan( mapCanvas ) );
mapCanvas->setMapTool( mMapToolPan.get() );

// Disable tabs by default
tabWidget->setTabEnabled( tabWidget->indexOf( paramTab ), false );
tabWidget->setTabEnabled( tabWidget->indexOf( metaTab ), false );
@@ -25,6 +25,7 @@
class QgsBrowserModel;
class QgsLayerItem;
class QgsMapLayer;
class QgsMapToolPan;

class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
{
@@ -79,6 +80,10 @@ class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
// last (selected) tab for each
QMap<QString, int> mLastTab;
QgsAttributeTableFilterModel* mAttributeTableFilterModel;

private:

std::unique_ptr< QgsMapToolPan > mMapToolPan;
};

#endif // QGSBROWSER_H

0 comments on commit 5c211ea

Please sign in to comment.
You can’t perform that action at this time.