接下来这个专题介绍PyQt的一些内容 教程翻译自: [https://www.tutorialspoint.com/pyqt/pyqt_introduction.htm](https://www.tutorialspoint.com/pyqt/pyqt_introduction.htm) 由于本人也是学习状态,翻译可能不准确,请及时指出,我会很快修正 一些关键字会直接使用英文 目前该专题为纯理论,实际操作在完成后有演示 PyQt版本: PyQt4 ##常用模块介绍 PyQt API是一系列模块的集合,超过了20多种,以下为一些经常用到的模块 **QtCore** Core non-GUI classes used by other modules **QtGui** Graphical user interface components **QtMultimedia** Classes for low-level multimedia programming **QtNetwork** Classes for network programming **QtOpenGL** OpenGL support classes **QtScript** Classes for evaluating Qt Scripts **QtSql** Classes for database integration using SQL **QtSvg** Classes for displaying the contents of SVG files **QtWebKit** Classes for rendering and editing HTML **QtXml** Classes for handling XML **QtAssistant** Support for online help **QtDesigner** Classes for extending Qt Designer ##常用类介绍 PyQt API 的模块总共有超过400个类 最上层的为 QObject类 他是所有Qt对象的基类 另外QPaintDevice 类是所有可画图对象的基类 QApplication类管理和控制GUI应用 QWidget 类由QObject 和QPaintDevice 继承而来 QDialog 和 QFrame由QWidget继承而来 [image:130 size:orig] [image:131 size:orig] [image:132 size:orig] [image:133 size:orig] [image:134 size:orig] -------- 一个典型的GUI程序一般是由QMainWindow Widget对象开始 其他的Widget采用不同的layout分布在MainWindow上面,如下图: [image:135 size:orig]