Skip to content

Commit

Permalink
Start restoring grids/overviews
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent 7f0142c commit 5d5c858
Show file tree
Hide file tree
Showing 21 changed files with 6,069 additions and 247 deletions.
3 changes: 3 additions & 0 deletions python/core/core_auto.sip
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions python/core/layout/qgslayoutitem.sip
Expand Up @@ -52,6 +52,7 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt

enum UndoCommand
{
UndoNone,
UndoIncrementalMove,
UndoIncrementalResize,
UndoStrokeColor,
Expand Down Expand Up @@ -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:
Expand Down
40 changes: 35 additions & 5 deletions python/core/layout/qgslayoutitemmap.sip
Expand Up @@ -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 );
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 5d5c858

Please sign in to comment.