官方的手册:
QWidget Class ReferenceThe QWidget class is the base class of all user interface objects. Inherits: QObject and QPaintDevice.Inherited by: ……, QDialog, ……,QMainWindow, ……QDialog Class ReferenceThe QDialog class is the base class of dialog windows.Inherits: QWidget.QMainWindow Class ReferenceThe QMainWindow class provides a main application window.Inherits: QWidget.可以看到QMainWindow和QDialog都是继承自QWidget。