[PyKDE] QTableComboBox problem

Phil Thompson phil at river-bank.demon.co.uk
Sun Dec 2 11:58:51 GMT 2001


Carter Sanders wrote:
> 
> Hi Phil-
> 
>         I still don't see what I'm doing wrong. I typed the code from memory before - here is the actual code and error message below. I don't know why self.sourceTable would be an invalid type. I amusing the latest PyQt and python 2.1.
> 
> Error message:
> 
> $ ./PDRWidget.py
> Traceback (most recent call last):
>   File "./PDRWidget.py", line 54, in ?
>     win = PDRWidget();
>   File "./PDRWidget.py", line 13, in __init__
>     PDRForm.__init__(self, parent)
>   File "./PDRForm.py", line 41, in __init__
>     self.ti=qttable.QComboTableItem(self,self.sourceTable,sourceTypes)
>   File "/usr/lib/python2.1/site-packages/qttable.py", line 55, in __init__
>     libqttablec.sipCallCtor(2,self,args)
> TypeError: Argument 1 of QComboTableItem() has an invalid type
> 
> relevant code:
> 
> from qt import *
> import qttable
> 
> class PDRForm(QWidget):
>     def __init__(self,parent = None,name = None,fl = 0):
>         QWidget.__init__(self,parent,name,fl)
> 
>          .
>          .
>          .
>         self.sourceTable = QTable(self,'sourceTable')
>         self.sourceTable.setGeometry(QRect(20,20,335,104))
>         sourceTypes=QStringList("backgndavgpdr all_gamma backgndmix")
>         self.ti=qttable.QComboTableItem(self,self.sourceTable,sourceTypes)
> 
> >Do you mean QComboTableItem?
> >
> >Python want the same as what C++ wants - a QTable as the 1st parameter,
> >a QStringList as the second parameter (not a Python list of strings),
> >and an optional boolean 3rd parameter.
> >
> >Phil

Omit the "self" parameter to the QComboTableItem ctor.

Phil




More information about the PyQt mailing list