本文整理汇总了Python中pyqtgraph.dockarea.DockArea.setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:Python DockArea.setMinimumSize方法的具体用法?Python DockArea.setMinimumSize怎么用?Python DockArea.setMinimumSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.dockarea.DockArea
的用法示例。
在下文中一共展示了DockArea.setMinimumSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GraphArea
# 需要导入模块: from pyqtgraph.dockarea import DockArea [as 别名]
# 或者: from pyqtgraph.dockarea.DockArea import setMinimumSize [as 别名]
#.........这里部分代码省略.........
if self.pbar is not None:
self.pbar.update(1)
# print('Time to add: %f' % (time() - cur))
# cur = time()
### Update layout ###
self.update_layout()
# print('Time to update layout: %f' % (time() - cur))
# cur = time()
### Update plots ###
self.update_plots()
# print('Time to update plots: %f' % (time() - cur))
# Update annotate toggle
if settings.annotation_on:
self.toggle_annotation.setChecked(not settings.hide_annotation)
# Update views
# print('updating')
if self.auto_default_range:
self.emit_x_range_updated()
self.emit_y_range_updated()
# print('updated')
if self.pbar is not None:
self.pbar.close()
self.pbar = None
# @timeit
def update_layout(self):
length = len(self.selected_depths)
self.dock_area.setMinimumSize(0, length * self.min_plot_height)
# Progress bar update
if self.pbar is not None:
self.pbar.set_description('Populating visual elements')
for depth in sorted(self.selected_depths.iterkeys(), reverse=True):
dock = self.selected_depths[depth]
self.dock_area.addDock(dock, position='bottom')
if self.pbar is not None:
self.pbar.update(1)
def add_plot_dock(self, depth, widget):
dock = Dock(depth, size=(1,1), closable=False, autoOrientation=False)
split_dock_widget = SplitDockWidget(widget)
### Connect signals ###
self.s.x_range_updated.connect(widget.set_x_range)
self.s.y_range_updated.connect(widget.set_y_range)
widget.s.title_updated.connect(dock.setTitle)
if settings.annotation_on:
self.toggle_annotation.toggled.connect(split_dock_widget.toggle_second_widget)
dock.addWidget(split_dock_widget)
self.selected_depths[depth] = dock
## Emit the signals necessary to update all the plots ##
def emit_x_range_updated(self):
self.s.x_range_updated.emit(
(float(self.x_range_min.text()), float(self.x_range_max.text()))
)
def emit_y_range_updated(self):
self.s.y_range_updated.emit(
(float(self.y_range_min.text()), float(self.y_range_max.text()))
)
# Update annotations across all the necessary depths for the patient
def update_annotations(self, update):
# Update is tuple of form (depths, labels)
depths, labels = update
ch_nr = self.src.get_channel_number(self.ccombo.value())
patient = self.src.patients[self.cur_patient]
for depth in depths:
# Update all annotation widgets
if depth in self.selected_depths:
dock = self.selected_depths[depth]
dock.widgets[0].update_annotation(labels)
# Update patient for depths not currently displayed
else:
# Calculate current id
cur_id = (depth, ch_nr)
# Check if depth_labels already has labels
if cur_id not in patient.depth_labels:
patient.depth_labels[cur_id] = list(labels)
else:
for label in labels:
if label not in patient.depth_labels[cur_id]:
patient.depth_labels[cur_id].append(label)