Update 对话框.md

This commit is contained in:
maicss 2016-10-06 17:09:10 +08:00
parent 73f1b8a477
commit 5d7c795990

View File

@ -160,12 +160,15 @@ if col.isValid():
% col.name())
```
我们可以预览颜色,如果点击取消按钮,没有颜色值返回,如果颜色是我们想要的,就从取色框里选择这个颜色。
We check if the colour is valid. If we click on the Cancel button, no valid colour is returned. If the colour is valid, we change the background colour using style sheets.
QFontDialog
程序展示:
The QFontDialog is a dialog widget for selecting a font.
todo截图
## QFontDialog
`QFontDialog`能做字体的选择。
```
#!/usr/bin/python3
# -*- coding: utf-8 -*-
@ -230,6 +233,7 @@ if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
```
In our example, we have a button and a label. With the QFontDialog, we change the font of the label.
font, ok = QFontDialog.getFont()