本文整理汇总了Python中PyQt4.QtGui.QListView.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Python QListView.setVisible方法的具体用法?Python QListView.setVisible怎么用?Python QListView.setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QListView
的用法示例。
在下文中一共展示了QListView.setVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RunDialog
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import setVisible [as 别名]
class RunDialog(QDialog):
def __init__(self, run_model, parent):
QDialog.__init__(self, parent)
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)
self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint)
self.setModal(True)
self.setWindowModality(Qt.WindowModal)
self.setWindowTitle("Simulations")
assert isinstance(run_model, BaseRunModel)
self._run_model = run_model
layout = QVBoxLayout()
layout.setSizeConstraint(QLayout.SetFixedSize)
self.simulations_tracker = SimulationsTracker()
states = self.simulations_tracker.getStates()
self.total_progress = SimpleProgress()
layout.addWidget(self.total_progress)
status_layout = QHBoxLayout()
status_layout.addStretch()
self.__status_label = QLabel()
status_layout.addWidget(self.__status_label)
status_layout.addStretch()
layout.addLayout(status_layout)
self.progress = Progress()
self.progress.setIndeterminateColor(self.total_progress.color)
for state in states:
self.progress.addState(state.state, QColor(*state.color), 100.0 * state.count / state.total_count)
layout.addWidget(self.progress)
self.detailed_progress = None
legend_layout = QHBoxLayout()
self.legends = {}
for state in states:
self.legends[state] = Legend("%s (%d/%d)", QColor(*state.color))
self.legends[state].updateLegend(state.name, 0, 0)
legend_layout.addWidget(self.legends[state])
layout.addLayout(legend_layout)
self.running_time = QLabel("")
ert = None
if isinstance(run_model, BaseRunModel):
ert = run_model.ert()
self.plot_tool = PlotTool()
self.plot_tool.setParent(None)
self.plot_button = QPushButton(self.plot_tool.getName())
self.plot_button.clicked.connect(self.plot_tool.trigger)
self.plot_button.setEnabled(ert is not None)
self.kill_button = QPushButton("Kill simulations")
self.done_button = QPushButton("Done")
self.done_button.setHidden(True)
self.restart_button = QPushButton("Restart")
self.restart_button.setHidden(True)
self.show_details_button = QPushButton("Details")
self.realizations_view = QListView()
self.realizations_view.setModel(QStandardItemModel(self.realizations_view))
self.realizations_view.setVisible(False)
button_layout = QHBoxLayout()
size = 20
spin_movie = resourceMovie("ide/loading.gif")
spin_movie.setSpeed(60)
spin_movie.setScaledSize(QSize(size, size))
spin_movie.start()
self.processing_animation = QLabel()
self.processing_animation.setMaximumSize(QSize(size, size))
self.processing_animation.setMinimumSize(QSize(size, size))
self.processing_animation.setMovie(spin_movie)
button_layout.addWidget(self.processing_animation)
button_layout.addWidget(self.running_time)
button_layout.addStretch()
button_layout.addWidget(self.show_details_button)
button_layout.addWidget(self.plot_button)
button_layout.addWidget(self.kill_button)
button_layout.addWidget(self.done_button)
button_layout.addWidget(self.restart_button)
layout.addStretch()
layout.addLayout(button_layout)
layout.addWidget(self.realizations_view)
self.setLayout(layout)
self.kill_button.clicked.connect(self.killJobs)
#.........这里部分代码省略.........