本文整理汇总了Python中peacock.utils.WidgetUtils.addProgressBar方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetUtils.addProgressBar方法的具体用法?Python WidgetUtils.addProgressBar怎么用?Python WidgetUtils.addProgressBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类peacock.utils.WidgetUtils
的用法示例。
在下文中一共展示了WidgetUtils.addProgressBar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCreation
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addProgressBar [as 别名]
def testCreation(self):
layout = WidgetUtils.addLayout()
WidgetUtils.addLineEdit(layout, None, self.callback)
WidgetUtils.addProgressBar(layout, None, callback=self.callback)
WidgetUtils.addButton(layout, None, "Button", self.callback)
WidgetUtils.addLabel(layout, None, "Name")
WidgetUtils.addCheckbox(layout, None, "name", self.callback)
示例2: __init__
# 需要导入模块: from peacock.utils import WidgetUtils [as 别名]
# 或者: from peacock.utils.WidgetUtils import addProgressBar [as 别名]
def __init__(self):
super(ExecuteRunnerPlugin, self).__init__()
self._preferences.addBool("execute/clearLog",
"Clear log before running",
False,
"Clear the output from previous runs before starting a new run",
)
self.top_layout = WidgetUtils.addLayout(vertical=True)
self.run_layout = WidgetUtils.addLayout()
self.run_layout.addStretch()
self.run_button = WidgetUtils.addButton(self.run_layout, None, "Run", self.runClicked, enabled=False)
self.kill_button = WidgetUtils.addButton(self.run_layout, None, "Kill", self.killClicked, enabled=False)
self.clear_button = WidgetUtils.addButton(self.run_layout, None, "Clear log", self.clearLog, enabled=True)
self.save_button = WidgetUtils.addButton(self.run_layout, None, "Save log", self.saveLog, enabled=True)
self.run_layout.addStretch()
self.progress_layout = WidgetUtils.addLayout()
self.progress_label = WidgetUtils.addLabel(self.progress_layout, None, "Progress: ")
self.progress_bar = WidgetUtils.addProgressBar(self.progress_layout, None)
self._showProgressBar(False)
self.setLayout(self.top_layout)
self.top_layout.addLayout(self.run_layout)
self.top_layout.addLayout(self.progress_layout)
self.runner = JobRunner()
self._total_steps = 0
self.runner.finished.connect(self.runFinished)
self.runner.outputAdded.connect(self.outputAdded)
self.runner.timeStepUpdated.connect(lambda t: self.runProgress.emit(t, self._total_steps))
self.runner.started.connect(lambda : self.runProgress.emit(0, self._total_steps))
self.runner.timeStepUpdated.connect(self._updateProgressBar)
self.exe_path = None
self.exe_args = []
self.has_csv = False
self._input_file = ""
self.setup()