Merge 5ab56907482180f291b154fb0b945f45d3b45fc4 into master

This commit is contained in:
maicss 2016-10-04 14:43:10 +08:00 committed by GitHub
commit 028c627b62

View File

@ -76,7 +76,7 @@ sys.exit(app.exec_())
exec_()之所以有个下划线是因为exec是一个Python的关键字。
程序预览:
[!simple](./images/1-simple.png)
![simple](./images/1-simple.png)
## 例2带窗口图标
@ -133,8 +133,9 @@ class Example(QWidget):
...
```
面向对象编程最重要的三个部分是类(class)、数据和方法。我们创建了一个类的调用这个类继承自QWidget。这就意味着我们调用了两个构造器一个是这个类本身的一个是这个类继承的。super()构造器方法返回父级的对象。`__init__()`方法是构造器的一个方法。
```
self.initUI()
```
The creation of the GUI is delegated to the initUI() method.
self.setGeometry(300, 300, 300, 220)