Skip to content
Permalink
Browse files

[composer] Fixes to composer item sip bindings

- Added some missing /TransferThis/ arguments
- Ensure that correct item type is returned for all item types
  • Loading branch information
nyalldawson committed Oct 18, 2014
1 parent c1b63df commit 71fbe9c9ceab5e9efeb44379b9ab07c237f283bf
@@ -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
@@ -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>
@@ -13,6 +16,7 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
#include <qgscomposerscalebar.h>
#include <qgscomposershape.h>
#include <qgscomposertable.h>
#include <qgscomposertexttable.h>
#include <qgscomposerattributetable.h>
%End

@@ -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);
@@ -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;
}
@@ -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 */

0 comments on commit 71fbe9c

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