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:
Any assistance will be appreciated
I am using Python version 3.4 and PyQt4 version 4.11.4
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
