Actually, I missed a few spots /TransferThis/ needed adding, the corrected patch attached to this message fixes the bug.
On Wed, 17 Apr 2002 17:27, James Grant wrote: > Hi, > > When I was creating QCanvasItems i noticed they were disappearing from the > QCanvas when they moved out of scope. When I create a global that > references them they stay. > > I'm guessing the problem has something to do with QCanvasItem and friends > missing the /TransferThis/ directive. I've tried recompiling with this on > QCanvasItem, QCanvasRectangle etc. But it still doesn't seem to work. > > Attached is a patch against CVS of what I tried. > > Any ideas? -- James.
--- qcanvas.sip.old Wed Apr 17 12:29:11 2002 +++ qcanvas.sip Wed Apr 17 18:10:36 2002 @@ -191,7 +191,7 @@ %End public: - QCanvasItem(QCanvas *); + QCanvasItem(QCanvas * /TransferThis/); double x() const; double y() const; @@ -505,7 +505,7 @@ %End public: - QCanvasSprite(QCanvasPixmapArray *,QCanvas *); + QCanvasSprite(QCanvasPixmapArray *,QCanvas * /TransferThis/); void setSequence(QCanvasPixmapArray *); @@ -586,7 +586,7 @@ %End public: - QCanvasPolygonalItem(QCanvas *); + QCanvasPolygonalItem(QCanvas * /TransferThis/); bool collidesWith(const QCanvasItem *) const; @@ -618,9 +618,9 @@ %End public: - QCanvasRectangle(QCanvas *); - QCanvasRectangle(const QRect &,QCanvas *); - QCanvasRectangle(int,int,int,int,QCanvas *); + QCanvasRectangle(QCanvas * /TransferThis/); + QCanvasRectangle(const QRect &,QCanvas * /TransferThis/); + QCanvasRectangle(int,int,int,int,QCanvas * /TransferThis/); int width() const; int height() const; @@ -646,7 +646,7 @@ %End public: - QCanvasPolygon(QCanvas *); + QCanvasPolygon(QCanvas * /TransferThis/); void setPoints(QPointArray); QPointArray points() const; @@ -670,7 +670,7 @@ %End public: - QCanvasSpline(QCanvas *); + QCanvasSpline(QCanvas * /TransferThis/); void setControlPoints(QPointArray,bool = 1); QPointArray controlPoints() const; @@ -689,7 +689,7 @@ %End public: - QCanvasLine(QCanvas *); + QCanvasLine(QCanvas * /TransferThis/); void setPoints(int,int,int,int); @@ -713,9 +713,9 @@ %End public: - QCanvasEllipse(QCanvas *); - QCanvasEllipse(int,int,QCanvas *); - QCanvasEllipse(int,int,int,int,QCanvas *); + QCanvasEllipse(QCanvas * /TransferThis/); + QCanvasEllipse(int,int,QCanvas * /TransferThis/); + QCanvasEllipse(int,int,int,int,QCanvas * /TransferThis/); int width() const; int height() const; @@ -741,9 +741,9 @@ %End public: - QCanvasText(QCanvas *); - QCanvasText(const QString &,QCanvas *); - QCanvasText(const QString &,QFont,QCanvas *); + QCanvasText(QCanvas * /TransferThis/); + QCanvasText(const QString &,QCanvas * /TransferThis/); + QCanvasText(const QString &,QFont,QCanvas * /TransferThis/); void setText(const QString &); void setFont(const QFont &);
