Skip to content

Commit

Permalink
[composer] Fixes to composer item sip bindings
Browse files Browse the repository at this point in the history
- Added some missing /TransferThis/ arguments
- Ensure that correct item type is returned for all item types
  • Loading branch information
nyalldawson committed Oct 19, 2014
1 parent c1b63df commit 71fbe9c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerframe.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class QgsComposerFrame: QgsComposerItem
%End

public:
QgsComposerFrame( QgsComposition* c, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height );
QgsComposerFrame( QgsComposition* c /TransferThis/, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height );
~QgsComposerFrame();

/**Sets the visible part of the multiframe's content which is visible within
Expand Down
14 changes: 9 additions & 5 deletions python/core/composer/qgscomposeritem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
{
%TypeHeaderCode
#include <qgscomposeritem.h>
#include <qgscomposerarrow.h>
#include <qgscomposerframe.h>
#include <qgscomposeritemgroup.h>
#include <qgscomposerlabel.h>
#include <qgscomposerlegend.h>
#include <qgscomposermap.h>
Expand All @@ -13,6 +16,7 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
#include <qgscomposerscalebar.h>
#include <qgscomposershape.h>
#include <qgscomposertable.h>
#include <qgscomposertexttable.h>
#include <qgscomposerattributetable.h>
%End

Expand All @@ -25,16 +29,14 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
sipClass = sipClass_QgsComposerItem;
*sipCppRet = static_cast<QgsComposerItem*>(sipCpp);
break;
#if 0
case QgsComposerItem::ComposerArrow:
sipClass = sipClass_QgsComposerArrow;
*sipCppRet = static_cast<QgsComposerArrow*>(sipCpp);
break;
break;
case QgsComposerItem::ComposerItemGroup:
sipClass = sipClass_QgsComposerItemGroup;
*sipCppRet = static_cast<QgsComposerItemGroup*>(sipCpp);
break;
#endif
case QgsComposerItem::ComposerLabel:
sipClass = sipClass_QgsComposerLabel;
*sipCppRet = static_cast<QgsComposerLabel*>(sipCpp);
Expand Down Expand Up @@ -71,12 +73,14 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
sipClass = sipClass_QgsComposerAttributeTable;
*sipCppRet = static_cast<QgsComposerAttributeTable*>(sipCpp);
break;
/*
case QgsComposerItem::ComposerTextTable:
sipClass = sipClass_QgsComposerTextTable;
*sipCppRet = static_cast<QgsComposerTextTable*>(sipCpp);
break;
*/
case QgsComposerItem::ComposerFrame:
sipClass = sipClass_QgsComposerFrame;
*sipCppRet = static_cast<QgsComposerFrame*>(sipCpp);
break;
default:
sipClass = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposeritemgroup.sip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class QgsComposerItemGroup: QgsComposerItem
#include <qgscomposeritemgroup.h>
%End
public:
QgsComposerItemGroup( QgsComposition* c );
QgsComposerItemGroup( QgsComposition* c /TransferThis/ );
~QgsComposerItemGroup();

/** return correct graphics item type. Added in v1.7 */
Expand Down

0 comments on commit 71fbe9c

Please sign in to comment.