[PyQt] SIP - argument 1 has invalid type

Jan Kaluza hanzz.k at gmail.com
Wed Dec 31 10:51:23 GMT 2008


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);
	~VideoWidget();

	virtual QSize sizeHint() const;

protected:
	virtual void paintEvent(QPaintEvent *event);

};

and here is what I'm trying to do:

PsiMedia.VideoWidget(QtGui.QWidget())
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?

Thank you for answer
Jan "HanzZ" Kaluza


More information about the PyQt mailing list