Skip to content
Permalink
Browse files

Start restoring grids/overviews

  • Loading branch information
nyalldawson committed Oct 21, 2017
1 parent 7f0142c commit 5d5c858dc89d3ae0b57223612bc868fed396123c
@@ -409,6 +409,9 @@
%Include layout/qgslayoutitem.sip
%Include layout/qgslayoutitemgroup.sip
%Include layout/qgslayoutitemmap.sip
%Include layout/qgslayoutitemmapgrid.sip
%Include layout/qgslayoutitemmapitem.sip
%Include layout/qgslayoutitemmapoverview.sip
%Include layout/qgslayoutitemnodeitem.sip
%Include layout/qgslayoutitempage.sip
%Include layout/qgslayoutitempolygon.sip
@@ -52,6 +52,7 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt

enum UndoCommand
{
UndoNone,
UndoIncrementalMove,
UndoIncrementalResize,
UndoStrokeColor,
@@ -550,6 +551,30 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
\param factor zoom factor, where > 1 results in a zoom in and < 1 results in a zoom out
\param point item point for zoom center
.. seealso:: moveContent()
%End

void beginCommand( const QString &commandText, UndoCommand command = UndoNone );
%Docstring
Starts new undo command for this item.
The ``commandText`` should be a capitalized, imperative tense description (e.g. "Add Map Item").
If specified, multiple consecutive commands for this item with the same ``command`` will
be collapsed into a single undo command in the layout history.
.. seealso:: endCommand()
.. seealso:: cancelCommand()
%End

void endCommand();
%Docstring
Completes the current item command and push it onto the layout's undo stack.
.. seealso:: beginCommand()
.. seealso:: cancelCommand()
%End

void cancelCommand();
%Docstring
Cancels the current item command and discards it.
.. seealso:: beginCommand()
.. seealso:: endCommand()
%End

public slots:
@@ -370,6 +370,41 @@ Returns true if the map contains layers with blend modes or flattened layers for
.. seealso:: atlasMargin
%End

QgsLayoutItemMapGridStack *grids();
%Docstring
Returns the map item's grid stack, which is used to control how grids
are drawn over the map's contents.
.. seealso:: grid()
:rtype: QgsLayoutItemMapGridStack
%End

QgsLayoutItemMapGrid *grid();
%Docstring
Returns the map item's first grid. This is a convenience function.
.. seealso:: grids()
:rtype: QgsLayoutItemMapGrid
%End

QgsLayoutItemMapOverviewStack *overviews();
%Docstring
Returns the map item's overview stack, which is used to control how overviews
are drawn over the map's contents.
:return: pointer to overview stack
.. seealso:: overview()
:rtype: QgsLayoutItemMapOverviewStack
%End

QgsLayoutItemMapOverview *overview();
%Docstring
Returns the map item's first overview. This is a convenience function.
:return: pointer to first overview for map item
.. seealso:: overviews()
:rtype: QgsLayoutItemMapOverview
%End

virtual QgsExpressionContext createExpressionContext() const;


protected:

virtual void draw( QgsRenderContext &context, const QStyleOptionGraphicsItem *itemStyle = 0 );
@@ -389,13 +424,9 @@ True if a draw is already in progress




virtual QRectF boundingRect() const;


virtual QgsExpressionContext createExpressionContext() const;


double mapUnitsToLayoutUnits() const;
%Docstring
Returns the conversion factor from map units to layout units.
@@ -404,7 +435,6 @@ True if a draw is already in progress
:rtype: float
%End


QPolygonF transformedMapPolygon() const;
%Docstring
Returns extent that considers rotation and shift with mOffsetX / mOffsetY

0 comments on commit 5d5c858

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