Skip to content

Commit a7ad0e6

Browse files
committed
Fix trailing-whitespace
1 parent 424e942 commit a7ad0e6

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

02-QtCore-非GUI的核心功能/01-The_Meta-Object_System-元对象系统.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ if (QLabel label = QLabel (obj)) { label.setText(tr("Ping"))
7474

7575
------
7676

77-
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](https://www.gnu.org/licenses/fdl-1.3.html) as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
77+
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the [GNU Free Documentation License version 1.3](https://www.gnu.org/licenses/fdl-1.3.html) as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
7878

7979
© 2022 zh_CN Translation by muzing\<[email protected]>.

03-QtWidgets-常用控件/01-QWidget-控件的基类/09-QWidget-键盘输入焦点-2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import sys
2-
3-
from PySide6 import QtWidgets
4-
from PySide6.QtCore import Qt
5-
61
"""
72
QWidget 键盘输入焦点控制
83
@@ -14,7 +9,7 @@
149
1510
https://doc.qt.io/qt-6/qwidget.html#setFocusProxy
1611
.setFocusPolicy(policy: Qt.FocusPolicy) 设置焦点策略,详见下方Qt.FocusPolicy
17-
.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略
12+
.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略
1813
1914
Qt.FocusPolicy 具体分为如下数种:
2015
https://doc.qt.io/qt-6/qt.html#FocusPolicy-enum
@@ -32,6 +27,11 @@
3227
3328
"""
3429

30+
import sys
31+
32+
from PySide6 import QtWidgets
33+
from PySide6.QtCore import Qt
34+
3535

3636
class MyWidget(QtWidgets.QWidget):
3737
def __init__(self, *args, **kwargs):

03-QtWidgets-常用控件/11-ComboBox-下拉框/01-QComboBox-组合下拉框/06-QComboBox-信号.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import sys
2-
3-
from PySide6 import QtCore, QtWidgets
4-
51
"""
62
QComboBox 信号
73
提供了多种精细的信号供使用
84
95
.activated(index: int)
106
当用户在组合下拉框中选中一个条目时发射此信号,索引作为参数传递。即使选中项未改变也会发射
11-
7+
128
.currentIndexChanged(index: int)
139
当当前索引由用户交互或编程方式改变时发射此信号,索引作为参数传递。
1410
若combobox为空或当前索引已重置,则传递条目的 index 或 -1
@@ -18,11 +14,11 @@
1814
1915
.editTextChanged(text: str)
2016
当启用了可编辑模式,且编辑器中的文本发生改变时发射此信号,新的文本作为参数传递
21-
17+
2218
.highlighted(index: int)
2319
当用户高亮(光标移入或键盘选择)了弹出菜单中的某一条目时发射此信号
2420
索引值作为参数传递
25-
21+
2622
.textActivated(text: str)
2723
当用户选择了条目之一时,发射此信号并将文本作为参数传递
2824
即使选择未发生改变也会发射此信号
@@ -33,6 +29,10 @@
3329
3430
"""
3531

32+
import sys
33+
34+
from PySide6 import QtCore, QtWidgets
35+
3636

3737
class MyWidget(QtWidgets.QWidget):
3838
def __init__(self, *args, **kwargs):

03-QtWidgets-常用控件/12-Dialog-对话框/01-QDialog-对话框基类/03-QDialog-槽、尺寸拖拽.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import sys
2-
3-
from PySide6 import QtCore, QtWidgets
4-
51
"""
62
QDialog 槽、结果、尺寸拖拽控件
73
@@ -14,7 +10,7 @@
1410
则done()也将导致局部事件循环结束,且exec()返回r。
1511
.exec() 将对话框作为模态对话框显示。(默认为应用程序级模态)此函数返回QDialog.Accepted或QDialog.Rejected。
1612
尽量避免使用exec()函数,而用open()替代。因为open()是异步的,并且不会增加额外的事件循环
17-
13+
1814
QDialog.result中保存了对话框获得的结果,也可以通过代码显式设置结果码:
1915
.result() -> int 获取模态对话框的结果码,QDialog.Accepted为1,QDialog.Rejected为0
2016
.setResult(i: int) 将模态对话框的结果码设置为i
@@ -30,6 +26,10 @@
3026
3127
"""
3228

29+
import sys
30+
31+
from PySide6 import QtCore, QtWidgets
32+
3333

3434
class MyWidget(QtWidgets.QWidget):
3535
def __init__(self, *args, **kwargs):

05-QtWidgets-进阶话题/02-QSS-样式表/01-QSS主题及编辑器.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class QSSLoader:
6767
```python
6868
app = QApplication(sys.argv)
6969
window = MainWindow()
70-
70+
7171
style_file = './style.qss'
7272
style_sheet = QSSLoader.read_qss_file(style_file)
7373
window.setStyleSheet(style_sheet)

0 commit comments

Comments
 (0)