摘要: QT中建议对UI的操作只能在主线程中,子线程的数据通过信号来发给主线程。 from PySide2.QtWidgets import QApplication,QTextBrowser from PySide2.QtUiTools import QUiLoader from threading im 阅读全文
posted @ 2020-09-27 15:03 JinweiChang 阅读(1064) 评论(0) 推荐(0) 编辑
摘要: 以下代码可以加载刚才设计的UI from PySide2.QtWidgets import QApplication from PySide2.QtUiTools import QUiLoader class Calc: def __init__(self): #加载刚才设计的.ui文件 self. 阅读全文
posted @ 2020-09-27 14:37 JinweiChang 阅读(410) 评论(0) 推荐(0) 编辑
摘要: QTDesigner通过托控件的方式设计UI,非常方便, 我做个小例子,通过点击按钮输入数字 1.打开QTDesigner,选择Widget→创建 2.将所需的控件拖入画板。9个按钮一个现实框。 3.布局:按钮1,2,3为一个水平布局, 4,5,6也为一个水平布局, 7,8,9也为一个水平布局, 然 阅读全文
posted @ 2020-09-27 14:23 JinweiChang 阅读(309) 评论(0) 推荐(0) 编辑