Skip to content

Commit 5d5c858

Browse files
committedNov 7, 2017
Start restoring grids/overviews
1 parent 7f0142c commit 5d5c858

21 files changed

+6069
-247
lines changed
 

‎python/core/core_auto.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@
409409
%Include layout/qgslayoutitem.sip
410410
%Include layout/qgslayoutitemgroup.sip
411411
%Include layout/qgslayoutitemmap.sip
412+
%Include layout/qgslayoutitemmapgrid.sip
413+
%Include layout/qgslayoutitemmapitem.sip
414+
%Include layout/qgslayoutitemmapoverview.sip
412415
%Include layout/qgslayoutitemnodeitem.sip
413416
%Include layout/qgslayoutitempage.sip
414417
%Include layout/qgslayoutitempolygon.sip

‎python/core/layout/qgslayoutitem.sip

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
5252

5353
enum UndoCommand
5454
{
55+
UndoNone,
5556
UndoIncrementalMove,
5657
UndoIncrementalResize,
5758
UndoStrokeColor,
@@ -550,6 +551,30 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
550551
\param factor zoom factor, where > 1 results in a zoom in and < 1 results in a zoom out
551552
\param point item point for zoom center
552553
.. seealso:: moveContent()
554+
%End
555+
556+
void beginCommand( const QString &commandText, UndoCommand command = UndoNone );
557+
%Docstring
558+
Starts new undo command for this item.
559+
The ``commandText`` should be a capitalized, imperative tense description (e.g. "Add Map Item").
560+
If specified, multiple consecutive commands for this item with the same ``command`` will
561+
be collapsed into a single undo command in the layout history.
562+
.. seealso:: endCommand()
563+
.. seealso:: cancelCommand()
564+
%End
565+
566+
void endCommand();
567+
%Docstring
568+
Completes the current item command and push it onto the layout's undo stack.
569+
.. seealso:: beginCommand()
570+
.. seealso:: cancelCommand()
571+
%End
572+
573+
void cancelCommand();
574+
%Docstring
575+
Cancels the current item command and discards it.
576+
.. seealso:: beginCommand()
577+
.. seealso:: endCommand()
553578
%End
554579

555580
public slots:

‎python/core/layout/qgslayoutitemmap.sip

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,41 @@ Returns true if the map contains layers with blend modes or flattened layers for
370370
.. seealso:: atlasMargin
371371
%End
372372

373+
QgsLayoutItemMapGridStack *grids();
374+
%Docstring
375+
Returns the map item's grid stack, which is used to control how grids
376+
are drawn over the map's contents.
377+
.. seealso:: grid()
378+
:rtype: QgsLayoutItemMapGridStack
379+
%End
380+
381+
QgsLayoutItemMapGrid *grid();
382+
%Docstring
383+
Returns the map item's first grid. This is a convenience function.
384+
.. seealso:: grids()
385+
:rtype: QgsLayoutItemMapGrid
386+
%End
387+
388+
QgsLayoutItemMapOverviewStack *overviews();
389+
%Docstring
390+
Returns the map item's overview stack, which is used to control how overviews
391+
are drawn over the map's contents.
392+
:return: pointer to overview stack
393+
.. seealso:: overview()
394+
:rtype: QgsLayoutItemMapOverviewStack
395+
%End
396+
397+
QgsLayoutItemMapOverview *overview();
398+
%Docstring
399+
Returns the map item's first overview. This is a convenience function.
400+
:return: pointer to first overview for map item
401+
.. seealso:: overviews()
402+
:rtype: QgsLayoutItemMapOverview
403+
%End
404+
405+
virtual QgsExpressionContext createExpressionContext() const;
406+
407+
373408
protected:
374409

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

390425

391426

392-
393427
virtual QRectF boundingRect() const;
394428

395429

396-
virtual QgsExpressionContext createExpressionContext() const;
397-
398-
399430
double mapUnitsToLayoutUnits() const;
400431
%Docstring
401432
Returns the conversion factor from map units to layout units.
@@ -404,7 +435,6 @@ True if a draw is already in progress
404435
:rtype: float
405436
%End
406437

407-
408438
QPolygonF transformedMapPolygon() const;
409439
%Docstring
410440
Returns extent that considers rotation and shift with mOffsetX / mOffsetY

0 commit comments

Comments
 (0)
Please sign in to comment.