*** GMX Spamverdacht *** [PyQt] Newbe needs help porting to (Py)Qt4

Andreas Pakulat apaku at gmx.de
Tue Apr 3 17:25:02 BST 2007


On 03.04.07 10:40:34, Lawrence Shafer wrote:
> Hello,
> 
> My first post here, and also my first python app.
> 
> I'm having trouble getting my Qt3 app wotking in Qt4. I have designed the UI in 
> QT-Designer and ported it to Qt4 with uic3 -convert, and removed all Qt3 
> support widgets. When I run the .py it complains:
> 
> Traceback (most recent call last):
>  File "testapp.py", line 100, in ?
>    app = HelloApplication(sys.argv)
>  File "testapp.py", line 20, in __init__
>    self.maindialog = TestAppUI(None)
>  File "testapp.py", line 31, in __init__
>    self._connectSlots()
>  File "testapp.py", line 42, in _connectSlots
>    self.connect(self.addbutton,SIGNAL("clicked()"),self._slotAddClicked)
> AttributeError: 'TestAppUI' object has no attribute 'connect'
> 
> Is this a change in QT, or one of my mistakes?

Read the designer manual, it covers what changed for .ui files.
Basically you need to derive from QMainWindow (or QWidget) + the
generated class and then run self.setupUi(self) to add the user
interface to the mainwindow.

Andreas

-- 
You two ought to be more careful--your love could drag on for years and years.


More information about the PyQt mailing list