Nov-20-2018, 03:53 PM
Hi all,
I am just starting to look into how to use Qt4 with Python 3.
I found an example that gives a skeleton Python file that I can use, but i'm getting a strange error
. Can anyone help?
PS. I'm using a Raspberry Pi2B, running Python 3.4.2 with Qt4. I tried adding an attachment of the Qt form but it doesn't seem to working on this browser.
I am just starting to look into how to use Qt4 with Python 3.
I found an example that gives a skeleton Python file that I can use, but i'm getting a strange error

PS. I'm using a Raspberry Pi2B, running Python 3.4.2 with Qt4. I tried adding an attachment of the Qt form but it doesn't seem to working on this browser.
import sys from PyQt4 import QtCore, QtGui, uic qtCreatorFile = "TestForm.ui" # Enter file here. Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile) class MyApp(QtGui.QMainWindow, Ui_MainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) window = MyApp() window.show() sys.exit(app.exec_())
Error:Traceback (most recent call last):
File "/home/pidev/Projects/Qt/PyQt_Test.py", line 16, in <module>
window = MyApp()
File "/home/pidev/Projects/Qt/PyQt_Test.py", line 12, in __init__
self.setupUi(self)
File "<string>", line 34, in setupUi
AttributeError: 'MyApp' object has no attribute 'accept'