On Wed, 31 Dec 2008 11:51:23 +0100, "Jan Kaluza" <[email protected]> wrote: > Hi, > I'm trying to wrap one C++ library to SIP and I have one problem with > constructor of one QWidget based class... Here is this class in .sip > file: > > class VideoWidget : QWidget > { > %TypeHeaderCode > #include <psimedia.h> > %End > public: > VideoWidget(QWidget *parent = 0);
You need to add a /TransferThis/ annotation to "parent". > ~VideoWidget(); > > virtual QSize sizeHint() const; > > protected: > virtual void paintEvent(QPaintEvent *event); > > }; > > and here is what I'm trying to do: > > PsiMedia.VideoWidget(QtGui.QWidget()) You need to keep a reference to the QWidget parent. > or PsiMedia.VideoWidget(self.ui.parent) > > the problem is here :) : > > Traceback (most recent call last): > File "test.py", line 790, in <module> > w=mainWindow() > File "test.py", line 471, in __init__ > self.previewSelf=PsiMedia.VideoWidget(QtGui.QWidget())#self.ui.vw_self) > TypeError: argument 1 of VideoWidget() has an invalid type > > > Does anybody know what I'm doing wrong? Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
