Fix trailing-whitespace

This commit is contained in:
muzing 2023-11-17 22:21:16 +08:00
parent 424e942f1a
commit a7ad0e6006
5 changed files with 20 additions and 20 deletions

View File

@ -74,6 +74,6 @@ if (QLabel label = QLabel (obj)) { label.setText(tr("Ping"))
------
© 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.
© 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.
© 2022 zh_CN Translation by muzing\<muzi2001@foxmail.com>.

View File

@ -1,8 +1,3 @@
import sys
from PySide6 import QtWidgets
from PySide6.QtCore import Qt
"""
QWidget 键盘输入焦点控制
@ -14,7 +9,7 @@ QWidget 键盘输入焦点控制
https://doc.qt.io/qt-6/qwidget.html#setFocusProxy
.setFocusPolicy(policy: Qt.FocusPolicy) 设置焦点策略详见下方Qt.FocusPolicy
.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略
.focusPolicy() -> Qt.FocusPolicy 返回该控件的焦点策略
Qt.FocusPolicy 具体分为如下数种
https://doc.qt.io/qt-6/qt.html#FocusPolicy-enum
@ -32,6 +27,11 @@ Qt.WheelFocus 补充:若只有一个控件设置为此策略,则需要当前
"""
import sys
from PySide6 import QtWidgets
from PySide6.QtCore import Qt
class MyWidget(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):

View File

@ -1,14 +1,10 @@
import sys
from PySide6 import QtCore, QtWidgets
"""
QComboBox 信号
提供了多种精细的信号供使用
.activated(index: int)
当用户在组合下拉框中选中一个条目时发射此信号索引作为参数传递即使选中项未改变也会发射
.currentIndexChanged(index: int)
当当前索引由用户交互或编程方式改变时发射此信号索引作为参数传递
若combobox为空或当前索引已重置则传递条目的 index -1
@ -18,11 +14,11 @@ QComboBox 信号
.editTextChanged(text: str)
当启用了可编辑模式且编辑器中的文本发生改变时发射此信号新的文本作为参数传递
.highlighted(index: int)
当用户高亮光标移入或键盘选择了弹出菜单中的某一条目时发射此信号
索引值作为参数传递
.textActivated(text: str)
当用户选择了条目之一时发射此信号并将文本作为参数传递
即使选择未发生改变也会发射此信号
@ -33,6 +29,10 @@ QComboBox 信号
"""
import sys
from PySide6 import QtCore, QtWidgets
class MyWidget(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):

View File

@ -1,7 +1,3 @@
import sys
from PySide6 import QtCore, QtWidgets
"""
QDialog 结果尺寸拖拽控件
@ -14,7 +10,7 @@ QDialog有一组槽用于显示、关闭对话框并返回结果
则done()也将导致局部事件循环结束且exec()返回r
.exec() 将对话框作为模态对话框显示默认为应用程序级模态此函数返回QDialog.Accepted或QDialog.Rejected
尽量避免使用exec()函数而用open()替代因为open()是异步的并且不会增加额外的事件循环
QDialog.result中保存了对话框获得的结果也可以通过代码显式设置结果码
.result() -> int 获取模态对话框的结果码QDialog.Accepted为1,QDialog.Rejected为0
.setResult(i: int) 将模态对话框的结果码设置为i
@ -30,6 +26,10 @@ QDialog可以指定是否在窗口右下角显示一个QSizeGrip控件方便
"""
import sys
from PySide6 import QtCore, QtWidgets
class MyWidget(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):

View File

@ -67,7 +67,7 @@ class QSSLoader:
```python
app = QApplication(sys.argv)
window = MainWindow()
style_file = './style.qss'
style_sheet = QSSLoader.read_qss_file(style_file)
window.setStyleSheet(style_sheet)