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