Fwd: [PyQt] Subclass pyuic4 generated file...

simozack simozack at yahoo.it
Fri Jan 16 19:47:13 GMT 2009

I forward this message to the list, because I send this only in
private. Sorry for the error.

---------- Forwarded message ----------
From: simozack <simozack at yahoo.it>
Date: 2009/1/16
Subject: Re: [PyQt] Subclass pyuic4 generated file...
To: NoursBleu <noursbleu at free.fr>

2009/1/16 NoursBleu <noursbleu at free.fr>:

> class Ui_ImageDialog(object):
>    def setupUi(self, ImageDialog):


> import sys
> from PyQt4 import QtCore, QtGui
> from Ui_test import Ui_ImageDialog
> class ImageDialog(QtGui.QDialog):
>    def __init__(self):
>        QtGui.QDialog.__init__(self)
>        self.ui = Ui_ImageDialog()
>        self.ui.setupUi(self)
>        #Modifications
>        self.ui.pushButton.setText("MyNewText")

Try this:

class ImageDialog(QtGui.QDialog, Ui_ImageDialog):
  def __init__(self, parent = None):
      QtGui.QDialog.__init__(self, parent)


This version is, IMHO, simpler and easier to manage.


More information about the PyQt mailing list