[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] SIP - argument 1 has invalid type
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2008-12-31 10:57:32
Message-ID: 5f0ddadb303d03e3040c8012c3380406 () localhost
[Download RAW message or body]

On Wed, 31 Dec 2008 11:51:23 +0100, "Jan Kaluza" <hanzz.k@gmail.com> 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    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic