Showing with 2,679 additions and 425 deletions.
  1. +1 −0 images/images.qrc
  2. BIN images/themes/default/mActionMap.png
  3. +9 −0 python/core/composer/qgscomposermap.sip
  4. +3 −0 python/core/composer/qgscomposition.sip
  5. +6 −1 python/core/layertree/qgslayertreegroup.sip
  6. +3 −0 python/core/layertree/qgslayertreemodel.sip
  7. +6 −1 python/core/layertree/qgslayertreenode.sip
  8. +1 −1 python/core/qgssnappingutils.sip
  9. +2 −0 python/gui/layertree/qgslayertreeview.sip
  10. +49 −0 python/gui/qgisinterface.sip
  11. +2 −2 python/gui/qgsgeometryrubberband.sip
  12. +3 −0 python/gui/qgsidentifymenu.sip
  13. +6 −0 python/gui/qgsmapcanvasitem.sip
  14. +1 −0 python/gui/qgsmapcanvassnappingutils.sip
  15. +16 −0 python/gui/qgsmaptool.sip
  16. +3 −0 python/gui/qgsmaptoolcapture.sip
  17. +3 −0 python/gui/qgsmaptoolidentify.sip
  18. +2 −2 python/gui/qgsrubberband.sip
  19. +84 −24 src/app/composer/qgscomposer.cpp
  20. +6 −3 src/app/composer/qgscomposer.h
  21. +58 −3 src/app/composer/qgscomposermapwidget.cpp
  22. +1 −0 src/app/composer/qgscomposermapwidget.h
  23. +1,192 −206 src/app/qgisapp.cpp
  24. +118 −3 src/app/qgisapp.h
  25. +80 −0 src/app/qgisappinterface.cpp
  26. +31 −0 src/app/qgisappinterface.h
  27. +52 −10 src/app/qgsapplayertreeviewmenuprovider.cpp
  28. +2 −2 src/app/qgsapplayertreeviewmenuprovider.h
  29. +22 −7 src/app/qgsattributetabledialog.cpp
  30. +1 −0 src/app/qgsattributetabledialog.h
  31. +2 −2 src/app/qgsdecorationgrid.cpp
  32. +33 −8 src/app/qgsidentifyresultsdialog.cpp
  33. +3 −2 src/app/qgsidentifyresultsdialog.h
  34. +8 −0 src/app/qgsmaptooladdcircularstring.cpp
  35. +2 −0 src/app/qgsmaptooladdcircularstring.h
  36. +1 −1 src/app/qgsmaptoolidentifyaction.cpp
  37. +7 −0 src/app/qgsmaptoolselectpolygon.cpp
  38. +3 −0 src/app/qgsmaptoolselectpolygon.h
  39. +35 −2 src/app/qgsmeasuretool.cpp
  40. +7 −0 src/app/qgsmeasuretool.h
  41. +2 −0 src/app/qgsoptions.cpp
  42. +2 −4 src/app/qgssnappingdialog.cpp
  43. +1 −6 src/app/qgssnappingdialog.h
  44. +5 −0 src/app/qgsstatusbarscalewidget.cpp
  45. +3 −0 src/app/qgsstatusbarscalewidget.h
  46. +2 −2 src/core/composer/qgscomposerattributetablev2.cpp
  47. +57 −13 src/core/composer/qgscomposermap.cpp
  48. +13 −1 src/core/composer/qgscomposermap.h
  49. +2 −2 src/core/composer/qgscomposerscalebar.cpp
  50. +7 −0 src/core/composer/qgscomposition.cpp
  51. +3 −0 src/core/composer/qgscomposition.h
  52. +7 −1 src/core/layertree/qgslayertree.h
  53. +16 −3 src/core/layertree/qgslayertreegroup.cpp
  54. +7 −2 src/core/layertree/qgslayertreegroup.h
  55. +59 −2 src/core/layertree/qgslayertreemodel.cpp
  56. +3 −0 src/core/layertree/qgslayertreemodel.h
  57. +6 −1 src/core/layertree/qgslayertreenode.h
  58. +1 −1 src/core/qgssnappingutils.h
  59. +2 −0 src/gui/CMakeLists.txt
  60. +91 −51 src/gui/layertree/qgslayertreemapcanvasbridge.cpp
  61. +2 −3 src/gui/layertree/qgslayertreemapcanvasbridge.h
  62. +43 −0 src/gui/layertree/qgslayertreeview.cpp
  63. +8 −0 src/gui/layertree/qgslayertreeview.h
  64. +23 −1 src/gui/qgisinterface.cpp
  65. +57 −0 src/gui/qgisinterface.h
  66. +1 −0 src/gui/qgsannotationitem.cpp
  67. +13 −0 src/gui/qgsgeometryrubberband.cpp
  68. +8 −2 src/gui/qgsgeometryrubberband.h
  69. +5 −0 src/gui/qgsidentifymenu.cpp
  70. +3 −0 src/gui/qgsidentifymenu.h
  71. +66 −2 src/gui/qgsmapcanvas.cpp
  72. +2 −0 src/gui/qgsmapcanvas.h
  73. +23 −0 src/gui/qgsmapcanvasitem.cpp
  74. +6 −0 src/gui/qgsmapcanvasitem.h
  75. +11 −2 src/gui/qgsmapcanvassnappingutils.cpp
  76. +1 −0 src/gui/qgsmapcanvassnappingutils.h
  77. +70 −0 src/gui/qgsmaptool.cpp
  78. +17 −0 src/gui/qgsmaptool.h
  79. +12 −0 src/gui/qgsmaptoolcapture.cpp
  80. +3 −0 src/gui/qgsmaptoolcapture.h
  81. +1 −1 src/gui/qgsmaptooledit.cpp
  82. +8 −0 src/gui/qgsmaptoolidentify.cpp
  83. +3 −0 src/gui/qgsmaptoolidentify.h
  84. +0 −1 src/gui/qgsmaptoolidentifyfeature.cpp
  85. +0 −1 src/gui/qgsmaptoolidentifyfeature.h
  86. +19 −0 src/gui/qgsrubberband.cpp
  87. +7 −2 src/gui/qgsrubberband.h
  88. +1 −1 src/plugins/coordinate_capture/coordinatecapture.cpp
  89. +9 −3 src/plugins/coordinate_capture/coordinatecapturemaptool.cpp
  90. +3 −1 src/plugins/coordinate_capture/coordinatecapturemaptool.h
  91. +9 −2 src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
  92. +1 −1 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.cpp
  93. +10 −9 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
  94. +1 −1 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp
  95. +8 −8 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  96. +1 −1 src/plugins/roadgraph/shortestpathwidget.cpp
  97. +5 −0 src/plugins/spatialquery/qgsrubberselectid.cpp
  98. +4 −0 src/plugins/spatialquery/qgsrubberselectid.h
  99. +20 −8 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  100. +16 −6 src/ui/composer/qgscomposermapwidgetbase.ui
  101. +14 −0 src/ui/qgisapp.ui
  102. +12 −0 src/ui/qgsoptionsbase.ui
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
<file>themes/default/mActionLocalCumulativeCutStretch.svg</file>
<file>themes/default/mActionLocalHistogramStretch.svg</file>
<file>themes/default/mActionLowerItems.svg</file>
<file>themes/default/mActionMap.png</file>
<file>themes/default/mActionMapTips.svg</file>
<file>themes/default/mActionMeasure.svg</file>
<file>themes/default/mActionMeasureAngle.svg</file>
Expand Down
Binary file added images/themes/default/mActionMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions python/core/composer/qgscomposermap.sip
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ class QgsComposerMap : QgsComposerItem
/** Sets canvas pointer (necessary to query and draw map canvas items)*/
void setMapCanvas( QGraphicsView* canvas /Transfer/ );

/** Returns the canvas pointer */
QGraphicsView* mapCanvas() const;

/** Returns the canvas name */
QString mapCanvasName() const;

/** Returns the map settings of the canvas */
const QgsMapSettings& mapSettings() const;

void setDrawCanvasItems( bool b );
bool drawCanvasItems() const;

Expand Down
3 changes: 3 additions & 0 deletions python/core/composer/qgscomposition.sip
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ class QgsComposition : QGraphicsScene
//! @note added in 2.4
const QgsMapSettings& mapSettings() const;

//! Returns the settings of the specified map canvas
virtual const QgsMapSettings& mapSettings( const QgsComposerMap* map ) const;

QgsComposition::PlotStyle plotStyle() const;
void setPlotStyle( const QgsComposition::PlotStyle style );

Expand Down
7 changes: 6 additions & 1 deletion python/core/layertree/qgslayertreegroup.sip
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class QgsLayerTreeGroup : QgsLayerTreeNode
%End

public:
QgsLayerTreeGroup( const QString& name = QString(), Qt::CheckState checked = Qt::Checked );
//! Constructor
QgsLayerTreeGroup( const QString& name = QString(), Qt::CheckState checked = Qt::Checked, NodeType nodeType = NodeGroup );

//! Get group's name
QString name() const;
Expand Down Expand Up @@ -82,6 +83,10 @@ class QgsLayerTreeGroup : QgsLayerTreeNode
//! @note added in 2.12
void setIsMutuallyExclusive( bool enabled, int initialChildIndex = -1 );

signals:
//! Emitted when the node was renamed
void nameChanged( const QString& oldName, const QString& newName );

protected slots:
void layerDestroyed();
void nodeVisibilityChanged( QgsLayerTreeNode* node );
Expand Down
3 changes: 3 additions & 0 deletions python/core/layertree/qgslayertreemodel.sip
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ class QgsLayerTreeModel : QAbstractItemModel

static const QIcon& iconGroup();

//! Returns the QIcon to draw a NodeMapGroup
static const QIcon& iconMapGroup();

//! Filter nodes from QgsMapLayerLegend according to the current filtering rules
QList<QgsLayerTreeModelLegendNode*> filterLegendNodes( const QList<QgsLayerTreeModelLegendNode*>& nodes );

Expand Down
7 changes: 6 additions & 1 deletion python/core/layertree/qgslayertreenode.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* - "embedded_project" - path to the external project (embedded root node only)
* - "legend/..." - properties for legend appearance customization
* - "expandedLegendNodes" - list of layer's legend nodes' rules in expanded state
* - "multimapOrphan" - node without a MapTreeGroup parent (multimap mode only),
* it will be deleted
* - "synchronizeExtent" - all MapTreeGroup nodes with this flag synchronize the
* extent of their related map canvas (multimap mode only)
*
* @see also QgsLayerTree, QgsLayerTreeLayer, QgsLayerTreeGroup
* @note added in 2.4
Expand Down Expand Up @@ -64,7 +68,8 @@ class QgsLayerTreeNode : QObject
enum NodeType
{
NodeGroup, //!< container of other groups and layers
NodeLayer //!< leaf node pointing to a layer
NodeLayer, //!< leaf node pointing to a layer
NodeMapGroup //!< container of a map canvas, for multimap view mode
};

~QgsLayerTreeNode();
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgssnappingutils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QgsSnappingUtils : QObject

public:
QgsSnappingUtils( QObject* parent /TransferThis/ = 0 );
~QgsSnappingUtils();
virtual ~QgsSnappingUtils();

// main actions

Expand Down
2 changes: 2 additions & 0 deletions python/gui/layertree/qgslayertreeview.sip
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class QgsLayerTreeView : QTreeView
QgsLayerTreeNode* currentNode() const;
//! Get current group node. If a layer is current node, the function will return parent group. May be null.
QgsLayerTreeGroup* currentGroupNode() const;
//! Get current map group node. May be null.
QgsLayerTreeGroup* currentMapGroupNode() const;

/** Get current legend node. May be null if current node is not a legend node.
* @note added in QGIS 2.14
Expand Down
49 changes: 49 additions & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class QgisInterface : QObject
%End

public:
//! Returns the QgisInterface singleton instance
static QgisInterface * instance();

/** Constructor */
QgisInterface();
Expand Down Expand Up @@ -158,6 +160,36 @@ class QgisInterface : QObject
/** Return a pointer to the map canvas */
virtual QgsMapCanvas * mapCanvas() = 0;

//! Return the collection of map canvas instances managed
virtual QList<QgsMapCanvas*> mapCanvases() = 0;

//! Create a new map canvas with the specified unique name
virtual QgsMapCanvas* createNewMapCanvas( const QString& mapName, bool activateObject = true, bool floatingWidget = true, const QRect& geometryForWidget = QRect() ) = 0;
//! Delete the map canvas with the specified name
virtual bool deleteMapCanvas( const QString& mapName ) = 0;

//! Get the default map canvas of the application
virtual QgsMapCanvas* defaultMapCanvas() = 0;
//! Get the map canvas with the specified name
virtual QgsMapCanvas* getMapCanvas( const QString& mapName ) = 0;
//! Get the map canvas that manages the specified layer
virtual QgsMapCanvas* getMapCanvas( QgsMapLayer* mapLayer ) = 0;

//! Set the active MapCanvas instance of the application (canvas gets selected in the legend)
virtual bool setActiveMapCanvas( const QString& mapName ) = 0;
//! Set the active MapCanvas instance of the application (canvas gets selected in the legend)
virtual bool setActiveMapCanvas( QgsMapCanvas *mapCanvas ) = 0;

//! Creates a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
virtual bool connectChangeableCanvas( const QgsMapCanvas* sender, const char* signal, const QObject* receiver, const char* member ) = 0;
//! Creates a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
virtual bool connectChangeableCanvas( const QObject* sender, const char* signal, const QgsMapCanvas* receiver, const char* member ) = 0;

//! Removes a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
virtual bool disconnectChangeableCanvas( const QgsMapCanvas* sender, const char* signal, const QObject* receiver, const char* member ) = 0;
//! Removes a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
virtual bool disconnectChangeableCanvas( const QObject* sender, const char* signal, const QgsMapCanvas* receiver, const char* member ) = 0;

/**
* Returns a pointer to the layer tree canvas bridge
*
Expand Down Expand Up @@ -358,6 +390,8 @@ class QgisInterface : QObject
virtual QAction *actionSaveProjectAs() = 0;
virtual QAction *actionSaveMapAsImage() = 0;
virtual QAction *actionProjectProperties() = 0;
//! Action to create a new map canvas
virtual QAction *actionNewMapCanvas() = 0;
virtual QAction *actionPrintComposer() = 0;
virtual QAction *actionShowComposerManager() = 0;
virtual QAction *actionExit() = 0;
Expand Down Expand Up @@ -528,6 +562,21 @@ class QgisInterface : QObject
virtual int messageTimeout() = 0;

signals:
/**
* This signal is emitted when the current (selected) map canvas is changed
*/
void currentMapCanvasChanged( QgsMapCanvas* mapCanvas );

/**
* This signal is emitted when a new map canvas instance has been created
*/
void mapCanvasAdded( QgsMapCanvas* mapCanvas );

/**
* This signal is emitted when a map canvas instance has been removed
*/
void mapCanvasRemoved( QgsMapCanvas* mapCanvas );

/** Emitted whenever current (selected) layer changes.
* The pointer to layer can be null if no layer is selected
*/
Expand Down
4 changes: 2 additions & 2 deletions python/gui/qgsgeometryrubberband.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
***************************************************************************/

/** A rubberband class for QgsAbstractGeometry (considering curved geometries)*/
class QgsGeometryRubberBand: QgsMapCanvasItem
class QgsGeometryRubberBand: QObject, QgsMapCanvasItem
{
%TypeHeaderCode
#include "qgsgeometryrubberband.h"
Expand Down Expand Up @@ -51,7 +51,7 @@ class QgsGeometryRubberBand: QgsMapCanvasItem
};

QgsGeometryRubberBand( QgsMapCanvas* mapCanvas, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::LineGeometry );
~QgsGeometryRubberBand();
virtual ~QgsGeometryRubberBand();

/** Sets geometry (takes ownership). Geometry is expected to be in map coordinates */
void setGeometry( QgsAbstractGeometry* geom /Transfer/ );
Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsidentifymenu.sip
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class QgsIdentifyMenu : QMenu
*/
QList<QgsMapToolIdentify::IdentifyResult> exec( const QList<QgsMapToolIdentify::IdentifyResult>& idResults, QPoint pos );

//! sets the map canvas
void setMapCanvas( QgsMapCanvas* mapCanvas );

protected:
virtual void closeEvent( QCloseEvent *e );
};
6 changes: 6 additions & 0 deletions python/gui/qgsmapcanvasitem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ class QgsMapCanvasItem : QGraphicsItem

//! transformation from map coordinates to screen coordinates
QPointF toCanvasCoordinates( const QgsPoint& point ) const;

//! sets the map canvas
virtual void setMapCanvas( QgsMapCanvas* mapCanvas );

//! returns pointer to the map canvas
QgsMapCanvas* mapCanvas();
};


1 change: 1 addition & 0 deletions python/gui/qgsmapcanvassnappingutils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class QgsMapCanvasSnappingUtils : QgsSnappingUtils
%End
public:
QgsMapCanvasSnappingUtils( QgsMapCanvas* canvas, QObject* parent = 0 );
virtual ~QgsMapCanvasSnappingUtils();

protected:
virtual void prepareIndexStarting( int count );
Expand Down
16 changes: 16 additions & 0 deletions python/gui/qgsmaptool.sip
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class QgsMapTool : QObject
//! called when map tool is being deactivated
virtual void deactivate();

//! sets the tool's map canvas
virtual void setMapCanvas( QgsMapCanvas* mapCanvas );

//! returns pointer to the tool's map canvas
QgsMapCanvas* canvas();

Expand Down Expand Up @@ -164,6 +167,19 @@ class QgsMapTool : QObject
//! transformation from map coordinates to screen coordinates
QPoint toCanvasCoordinates( const QgsPoint& point );

//! Creates a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
void connect( const QgsMapCanvas* sender, const char* signal, const QObject* receiver, const char* member );
//! Creates a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
void connect( const QObject* sender, const char* signal, const QgsMapCanvas* receiver, const char* member );
//! Creates a connection of the given type from the signal in the sender object to the method in the receiver object
void connect( const QObject* sender, const char* signal, const QObject* receiver, const char* member );

//! Removes a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
void disconnect( const QgsMapCanvas* sender, const char* signal, const QObject* receiver, const char* member );
//! Removes a changeable MapCanvas connection of the given type from the signal in the sender object to the method in the receiver object
void disconnect( const QObject* sender, const char* signal, const QgsMapCanvas* receiver, const char* member );
//! Removes a connection of the given type from the signal in the sender object to the method in the receiver object
void disconnect( const QObject* sender, const char* signal, const QObject* receiver, const char* member );

};

Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsmaptoolcapture.sip
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
//! deactive the tool
virtual void deactivate();

//! sets the tool's map canvas
virtual void setMapCanvas( QgsMapCanvas* mapCanvas );

/** Adds a whole curve (e.g. circularstring) to the captured geometry. Curve must be in map CRS*/
int addCurve( QgsCurve* c );

Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsmaptoolidentify.sip
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class QgsMapToolIdentify : QgsMapTool
//! this menu can also be customized
QgsIdentifyMenu* identifyMenu();

//! sets the tool's map canvas
virtual void setMapCanvas( QgsMapCanvas* mapCanvas );

public slots:
void formatChanged( QgsRasterLayer *layer );

Expand Down
4 changes: 2 additions & 2 deletions python/gui/qgsrubberband.sip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class QgsRubberBand: QgsMapCanvasItem
class QgsRubberBand: QObject, QgsMapCanvasItem
{
%TypeHeaderCode
#include <qgsrubberband.h>
Expand Down Expand Up @@ -41,7 +41,7 @@ class QgsRubberBand: QgsMapCanvasItem
* @param geometryType Defines how the data should be drawn onto the screen. (Use QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry or QgsWkbTypes::PointGeometry)
*/
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, QgsWkbTypes::GeometryType geometryType = QgsWkbTypes::LineGeometry );
~QgsRubberBand();
virtual ~QgsRubberBand();

/**
* Set the color for the rubberband
Expand Down
Loading