Skip to content

Commit

Permalink
Use a pan tool in the browser canvas preview
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 17, 2017
1 parent 7c4f879 commit 5c211ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/browser/qgsbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 );
Expand Down
5 changes: 5 additions & 0 deletions src/browser/qgsbrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class QgsBrowserModel;
class QgsLayerItem;
class QgsMapLayer;
class QgsMapToolPan;

class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
{
Expand Down Expand Up @@ -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.