Hi and thank a lot for your help,<br><br>You'r right.<br>I forgot these lines<br><br>app = QtGui.QApplication(sys.argv)<br>window = ImageDialog()<br>window.show()<br>sys.exit(app.exec_())<br><br>But there is another problem. The code produced by "designer"
Qt-4.2.1 is not compatible with Qt-4.1.4 !! QDialogButtonBox is new in Qt-4.2 !!<br><br>Also, be carefull to comment also in ui_imagedialog.py this line<br><br><pre class="literal-block">#self.ui.colorDepthCombo.addItem("2 colors (1 bit per pixel)")
<br><br></pre>Bye, Simon.<br><br><br><div><span class="gmail_quote">2006/11/11, Phil Thompson <<a href="mailto:phil@riverbankcomputing.co.uk">phil@riverbankcomputing.co.uk</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Friday 10 November 2006 3:43 pm, simon stockes wrote:<br>> Hi,<br>><br>> With the pyqtref manual, I try to test base2.py (see below the code). But<br>> this one does not produce anything !!<br>> Is it the same for you ?
<br>><br>> Simon<br>><br>> Config : rhel4, pyqt-4.0.1, qt4.1.4<br>><br>><br>><br>> Base2.py<br>> =======<br>><br>> from PyQt4 import QtCore, QtGui<br>> from ui_imagedialog import Ui_ImageDialog
<br>><br>> class ImageDialog(QtGui.QDialog):<br>> def __init__(self):<br>> QtGui.QDialog.__init__(self)<br>><br>> # Set up the user interface from Designer.<br>> self.ui = Ui_ImageDialog()
<br>> self.ui.setupUi(self)<br>><br>> # Make some local modifications.<br>> self.ui.colorDepthCombo.addItem("2 colors (1 bit per pixel)")<br>><br>> # Connect up the buttons.
<br>> self.connect(self.ui.okButton, QtCore.SIGNAL("clicked()"),<br>> self, QtCore.SLOT("accept()"))<br>> self.connect(self.ui.cancelButton, QtCore.SIGNAL("clicked()"),
<br>> self, QtCore.SLOT("reject()"))<br>><br>> ui_imagedialog.py<br>> =============<br>><br>> import sys<br>> from PyQt4 import QtCore, QtGui<br>><br>> class Ui_ImageDialog(object):
<br>> def setupUi(self, ImageDialog):<br>> ImageDialog.setObjectName("ImageDialog")<br>> ImageDialog.resize(QtCore.QSize(QtCore.QRect<br>> (0,0,420,300).size()).expandedTo(ImageDialog.minimumSizeHint
()))<br>><br>> self.buttonBox = QtGui.QDialogButtonBox(ImageDialog)<br>> self.buttonBox.setGeometry(QtCore.QRect(30,240,341,32))<br>> self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
<br>> self.buttonBox.setStandardButtons(<br>> QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.NoButton|QtGui.QDialog<br>>ButtonBox.Ok )<br>> self.buttonBox.setObjectName("buttonBox")
<br>><br>> self.retranslateUi(ImageDialog)<br>> QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("accepted()"),<br>> ImageDialog.accept)<br>> QtCore.QObject.connect(self.buttonBox
,QtCore.SIGNAL("rejected()"),<br>> ImageDialog.reject)<br>> QtCore.QMetaObject.connectSlotsByName(ImageDialog)<br>><br>> def retranslateUi(self, ImageDialog):<br>><br>> ImageDialog.setWindowTitle
(QtGui.QApplication.translate("ImageDialog",<br>> "Dialog", None, QtGui.QApplication.UnicodeUTF8))<br><br>Is this the complete application? If so, then yes, it does the same for me -<br>because you haven't created the QApplication instance, entered the event loop
<br>etc, etc.<br><br>Phil<br></blockquote></div><br>