【发布时间】:2016-01-24 09:59:19
【问题描述】:
我正在学习使用 pyQt4 的 GUI python。我在另一个文件 python 中有函数A。我想在我从文件.ui(设计师pyQt4的输出)中提取的GUI文件python中运行。如何创建在函数A 运行时处于活动状态的活动指示器?我可以在不知道我的函数A 运行多少时间的情况下使用进度条(在 pyQt4 设计器中)吗?
谢谢。
这是在 GUI .py 中调用A 的函数:
def RunFunction():
import Kdtree
_dir = kdTreeOk.getNeighbor(float(radius)) #function 'A'
file = file_open('Summary.txt',_dir) # ignore, just file to save result of `A`
with file:
textOutput=file.read()
ui.result.setPlainText(textOutput)
#### button to run RunFunction in file GUI .py
ui._run.clicked.connect(RunFunction)
【问题讨论】:
-
A是否以任何方式与 GUI 交互? (它会调用 PyQt 函数吗?) -
我在文件 GUI .py 中创建函数来调用
A。然后我连接按钮以使用该功能运行A。我将编写调用A的函数。
标签: python-2.7 pyqt4