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 15:47:23 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,7 +618,7 @@ %End public: - QCanvasRectangle(QCanvas *); + QCanvasRectangle(QCanvas * /TransferThis/); QCanvasRectangle(const QRect &,QCanvas *); QCanvasRectangle(int,int,int,int,QCanvas *); @@ -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,7 +713,7 @@ %End public: - QCanvasEllipse(QCanvas *); + QCanvasEllipse(QCanvas * /TransferThis/); QCanvasEllipse(int,int,QCanvas *); QCanvasEllipse(int,int,int,int,QCanvas *); @@ -741,7 +741,7 @@ %End public: - QCanvasText(QCanvas *); + QCanvasText(QCanvas * /TransferThis/); QCanvasText(const QString &,QCanvas *); QCanvasText(const QString &,QFont,QCanvas *);
