wheflower.blogg.se

Pyqt program structure
Pyqt program structure





pyqt program structure

And we're done! As a reminder, the _init_ method is a method that will run open the creation of any object from the class.

pyqt program structure pyqt program structure

we can reference all of the methods that we've inherited from QtGui.QMainWindow, as well as any methods we write ourselves in this class. Notice now that to reference various aspects, we use "self." Self references the current class, which, again, is a QT object, so this means with self. The rest of the code you have already seen, besides the icon, which should make sense. We use super so that this window returns the parent object, so that it acts like a QT object. Use super so we return parent object of this classįirst off, the reason why we want to inherit from the QtGui.QMainWindow class is so that we can utilize all of the GUI aspects that QT gives us out of the gate, but we still want to wind up creating our own class for customization. Create class, inherit from QtGui.QMainWindow







Pyqt program structure