[PyKDE] QTableComboBox problem

Carter Sanders carter at cartersanders.com
Sun Dec 2 08:06:28 GMT 2001


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





More information about the PyQt mailing list