[PyQt] Invoking user interface design - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [PyQt] Invoking user interface design (/thread-3424.html) |
Invoking user interface design - 12203276 - May-22-2017 Hey everyone, I am currently teaching myself to use PyQt4 and I have one problem that I do not know how to fix. When I design my interface in PyQt4 and convert it to py and import it into my Python script nothing seems to happen. I got the code from a textbook, Please see code below: import sys from fairCalculator import * from PyQt4.QtGui import * class MyForm(QtGui.QDialog): def ___init___(self, parent = None): QtGui.QWidget.___init___(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) timer = QtCore.QTimer(self) timer.timeout.connect(self.showlcd) timer.start(1000) self.showlcd() QtGui.QObject.connect(self.ui.buttonOne, QtCore.SIGNAL('clicked()'), self.buttonOne) def buttonOne(self): self.ui.label.setText("Please pay R 10.00 for Class One.") def showlcd(self): time = QtCore.QTime.currentTime() text = time.toString('hh:mm') self.ui.lcdNumber.display(text) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) myapp = MyForm() myapp.show() sys.exit(app.exec_())When I press F5 to run the program I do not get any errors but the interface do not show. A window named Pythonw but nothing appears on the screen it's just a blank window. Now I have tried to re-install the programs I even tried different versions, I even went so far to test it on three different computers and the result is the same. Any assistance will be appreciated I am using Python version 3.4 and PyQt4 version 4.11.4 RE: Invoking user interface design - Larz60+ - May-22-2017 you are suposed to put the code in the code box, not around it |