mirror of
https://github.com/maicss/PyQt5-Chinese-tutorial.git
synced 2025-01-24 21:12:54 +08:00
Update 对话框.md
This commit is contained in:
parent
73f1b8a477
commit
5d7c795990
10
对话框.md
10
对话框.md
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user