QWidget是pyqt中最重要的类,它实际是继承了:
- QObject
- QPaintDevice
可以说我们所有操作的图形控件都是从这里继承来的。QWidget包含了控件的基本属性和基本操作,所以在看其他控件的时候只要比较针对QWidget的不同之处就可以了。具体细节传送门 。
QWidget
- Widget的分类:
- Window:A widget that is not embedded in a parent widget is called a window
- window flags
- .setWindoTitle()
- .setWindowIcon()
- .setSizePolicy()
- child widget
- Composite Widget,包含child的widget,可以是window,也可以是child
- Window:A widget that is not embedded in a parent widget is called a window
- Layout:child widget的排版方式
- child class
- QDialog
- QMainWindow常用为main window
- QDialog
- Event:widget接受QT发来的event,并进行处理,如果要实现自己对应的功能需要重载这些函数
- mouse movement
- button presses
- keyboard
- window resizing
- focus In/Out
- funcation & properties
- Widnow
- Top-level window
- Window contects
- Geometry
- Mode
- Look & feel
- .setAttribute()
- Translucent Windows
- .setAttribute()
- focus
- mouse & keyboard grabbing
- event handlers
- system functions
- interactive help
原文链接:http://software.intel.com/zh-cn/blogs/2010/04/22/meegoqt-qwidget-modules/