當前位置: 首頁>>代碼示例>>Python>>正文


Python DockArea.setMinimumSize方法代碼示例

本文整理匯總了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)
開發者ID:eagonmeng,項目名稱:Bamboo,代碼行數:104,代碼來源:graph_area.py


注:本文中的pyqtgraph.dockarea.DockArea.setMinimumSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。