[PyQt] help

M.J. Bell mjb213 at cam.ac.uk
Wed Sep 2 01:42:39 BST 2009


Hi

I wonder whether anyone might be able to help me? 

I have some code that was written on linux using PyQt3, and I am trying to 
get it to run on windows. It produces a simple experiment in which 
participants move a slider in response to sounds they hear. I believe that 
PyQt3 is not available for windows (is that right?) and so I am trying to 
port the code to PyQt4. I have changed the library names to reflect the 
different structure, but now I am getting the following message:

Traceback (most recent call last):
  File "C:\Python26\Lib\site-packages\Perception\perception.py", line 250, 
in <module>
    Participants = myParticipantData ()
  File "C:\Python26\Lib\site-packages\Perception\participant_data_ui.py", 
line 19, in __init__
    QtGui.QDialog.__init__(self, parent, name, modal, fl)
TypeError: argument 2 of PyQt4.QtGui.QDialog() has an invalid type

#The relevant lines in perception.py are:

class myParticipantData(participant_data_ui.ParticipantData):
    def Cancel (self):
        global Abort
        Abort = True
        self.close ()

#and

app = PyQt4.Qt.QApplication (sys.argv)
    Participants = myParticipantData ()
    Participants.SubjectID.setText ('%s' % SpeakerID)

#In participant_data_ui I have

import PyQt4
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.QtCore import *

class ParticipantData(QtGui.QDialog):
    def __init__(self, parent = None, name = None, modal = 0, fl = 0):
        QtGui.QDialog.__init__(self, parent, name, modal, fl)

        if not name:
            self.setName("ParticipantData")

Does anyone know what the problem is and how to fix it? I'm at my wits end! 
Please let me know if you need more code and/or information - I wasn't sure 
how much to include.

Yours hopefully

Melanie









More information about the PyQt mailing list