Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jun 20, 2017
1 parent eddd258 commit 009e47e
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerlabel.sip
Expand Up @@ -19,7 +19,7 @@ class QgsComposerLabel: QgsComposerItem
#include "qgscomposerlabel.h"
%End
public:
QgsComposerLabel( QgsComposition *composition );
QgsComposerLabel( QgsComposition *composition /TransferThis/ );
~QgsComposerLabel();

virtual int type() const;
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerlegend.sip
Expand Up @@ -47,7 +47,7 @@ class QgsComposerLegend : QgsComposerItem
#include "qgscomposerlegend.h"
%End
public:
QgsComposerLegend( QgsComposition *composition );
QgsComposerLegend( QgsComposition *composition /TransferThis/ );

virtual int type() const;
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposermapgrid.sip
Expand Up @@ -507,7 +507,7 @@ class QgsComposerMapGrid : QgsComposerMapItem
:rtype: QgsLineSymbol
%End

void setMarkerSymbol( QgsMarkerSymbol *symbol );
void setMarkerSymbol( QgsMarkerSymbol *symbol /Transfer/ );
%Docstring
Sets the marker symbol used for drawing grid points. This is only used for grids with a
QgsComposerMapGrid.Markers style.
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposermapitem.sip
Expand Up @@ -186,7 +186,7 @@ class QgsComposerMapItemStack

protected:

void addItem( QgsComposerMapItem *item );
void addItem( QgsComposerMapItem *item /Transfer/ );
%Docstring
Adds a new map item to the stack and takes ownership of the item.
The item will be added to the end of the stack, and rendered
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerpicture.sip
Expand Up @@ -43,7 +43,7 @@ class QgsComposerPicture: QgsComposerItem
TrueNorth,
};

QgsComposerPicture( QgsComposition *composition );
QgsComposerPicture( QgsComposition *composition /TransferThis/ );

virtual int type() const;
%Docstring
Expand Down
18 changes: 16 additions & 2 deletions python/core/composer/qgscomposition.sip
Expand Up @@ -539,6 +539,16 @@ Reads settings from xml file
:rtype: bool
%End

void addItemsFromXml( const QDomElement &elem, const QDomDocument &doc,
bool addUndoCommands = false, QPointF *pos = 0, bool pasteInPlace = false );
%Docstring
Add items from XML representation to the graphics scene (for project file reading, pasting items from clipboard)
\param elem items parent element, e.g. \verbatim <Composer> \endverbatim or \verbatim <ComposerItemClipboard> \endverbatim
\param doc xml document
\param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
\param pos item position. Optional, take position from xml if 0
\param pasteInPlace whether the position should be kept but mapped to the page origin. (the page is the page under to the mouse cursor)
%End

void addItemToZList( QgsComposerItem *item );
%Docstring
Expand Down Expand Up @@ -680,6 +690,10 @@ Adds multiframe. The object is owned by QgsComposition until removeMultiFrame is
Removes multi frame (but does not delete it)
%End

void addComposerArrow( QgsComposerArrow *arrow );
%Docstring
Adds an arrow item to the graphics scene and advises composer to create a widget for it (through signal)
%End
void addComposerLabel( QgsComposerLabel *label );
%Docstring
Adds label to the graphics scene and advises composer to create a widget for it (through signal)
Expand Down Expand Up @@ -712,11 +726,11 @@ Adds a composer polygon and advises composer to create a widget for it (through
%Docstring
Adds a composer polyline and advises composer to create a widget for it (through signal)
%End
void addComposerHtmlFrame( QgsComposerHtml *html, QgsComposerFrame *frame );
void addComposerHtmlFrame( QgsComposerHtml *html /Transfer/, QgsComposerFrame *frame /Transfer/ );
%Docstring
Adds composer html frame and advises composer to create a widget for it (through signal)
%End
void addComposerTableFrame( QgsComposerAttributeTableV2 *table, QgsComposerFrame *frame );
void addComposerTableFrame( QgsComposerAttributeTableV2 *table /Transfer/, QgsComposerFrame *frame /Transfer/ );
%Docstring
Adds composer tablev2 frame and advises composer to create a widget for it (through signal)
%End
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerlabel.h
Expand Up @@ -33,7 +33,7 @@ class CORE_EXPORT QgsComposerLabel: public QgsComposerItem
{
Q_OBJECT
public:
QgsComposerLabel( QgsComposition *composition );
QgsComposerLabel( QgsComposition *composition SIP_TRANSFERTHIS );
~QgsComposerLabel();

//! Return correct graphics item type.
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerlegend.h
Expand Up @@ -59,7 +59,7 @@ class CORE_EXPORT QgsComposerLegend : public QgsComposerItem
Q_OBJECT

public:
QgsComposerLegend( QgsComposition *composition );
QgsComposerLegend( QgsComposition *composition SIP_TRANSFERTHIS );

//! Return correct graphics item type.
virtual int type() const override { return ComposerLegend; }
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermapgrid.h
Expand Up @@ -509,7 +509,7 @@ class CORE_EXPORT QgsComposerMapGrid : public QgsComposerMapItem
* \see setLineSymbol
* \see setStyle
*/
void setMarkerSymbol( QgsMarkerSymbol *symbol );
void setMarkerSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );

/** Gets the marker symbol used for drawing grid points. This is only used for grids with a
* QgsComposerMapGrid::Markers style.
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermapitem.h
Expand Up @@ -183,7 +183,7 @@ class CORE_EXPORT QgsComposerMapItemStack
* should be called for the QgsComposerMap to prevent rendering artifacts
* \see removeItem
*/
void addItem( QgsComposerMapItem *item );
void addItem( QgsComposerMapItem *item SIP_TRANSFER );

/** Removes an item from the stack and deletes the corresponding QgsComposerMapItem
* \param itemId id for the QgsComposerMapItem to remove
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerpicture.h
Expand Up @@ -61,7 +61,7 @@ class CORE_EXPORT QgsComposerPicture: public QgsComposerItem
TrueNorth, //!< Align to true north
};

QgsComposerPicture( QgsComposition *composition );
QgsComposerPicture( QgsComposition *composition SIP_TRANSFERTHIS );

//! Return correct graphics item type.
virtual int type() const override { return ComposerPicture; }
Expand Down
12 changes: 5 additions & 7 deletions src/core/composer/qgscomposition.h
Expand Up @@ -489,10 +489,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionCo
* \param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
* \param pos item position. Optional, take position from xml if 0
* \param pasteInPlace whether the position should be kept but mapped to the page origin. (the page is the page under to the mouse cursor)
* \note parameters mapsToRestore, addUndoCommands pos and pasteInPlace not available in Python bindings
*/
void addItemsFromXml( const QDomElement &elem, const QDomDocument &doc,
bool addUndoCommands = false, QPointF *pos = nullptr, bool pasteInPlace = false ) SIP_SKIP;
bool addUndoCommands = false, QPointF *pos = nullptr, bool pasteInPlace = false );

//! Adds item to z list. Usually called from constructor of QgsComposerItem
void addItemToZList( QgsComposerItem *item );
Expand Down Expand Up @@ -597,9 +596,8 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionCo
//! Removes multi frame (but does not delete it)
void removeMultiFrame( QgsComposerMultiFrame *multiFrame );

/** Adds an arrow item to the graphics scene and advises composer to create a widget for it (through signal)
\note not available in Python bindings*/
void addComposerArrow( QgsComposerArrow *arrow ) SIP_SKIP;
//! Adds an arrow item to the graphics scene and advises composer to create a widget for it (through signal)
void addComposerArrow( QgsComposerArrow *arrow );
//! Adds label to the graphics scene and advises composer to create a widget for it (through signal)
void addComposerLabel( QgsComposerLabel *label );
//! Adds map to the graphics scene and advises composer to create a widget for it (through signal)
Expand All @@ -617,9 +615,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene, public QgsExpressionCo
//! Adds a composer polyline and advises composer to create a widget for it (through signal)
void addComposerPolyline( QgsComposerPolyline *polyline );
//! Adds composer html frame and advises composer to create a widget for it (through signal)
void addComposerHtmlFrame( QgsComposerHtml *html, QgsComposerFrame *frame );
void addComposerHtmlFrame( QgsComposerHtml *html SIP_TRANSFER, QgsComposerFrame *frame SIP_TRANSFER );
//! Adds composer tablev2 frame and advises composer to create a widget for it (through signal)
void addComposerTableFrame( QgsComposerAttributeTableV2 *table, QgsComposerFrame *frame );
void addComposerTableFrame( QgsComposerAttributeTableV2 *table SIP_TRANSFER, QgsComposerFrame *frame SIP_TRANSFER );

//! Remove item from the graphics scene. Additionally to QGraphicsScene::removeItem, this function considers undo/redo command
void removeComposerItem( QgsComposerItem *item, const bool createCommand = true, const bool removeGroupItems = true );
Expand Down

0 comments on commit 009e47e

Please sign in to comment.