plot_container.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:gui_tool 作者: UAVCAN 项目源码 文件源码
def __init__(self, parent, plot_area_class, active_data_types):
        super(PlotContainerWidget, self).__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose)              # This is required to stop background timers!

        self.on_close = lambda: None

        self._plot_area = plot_area_class(self, display_measurements=self.setWindowTitle)

        self.update = self._plot_area.update
        self.reset = self._plot_area.reset

        self._active_data_types = active_data_types
        self._extractors = []

        self._new_extractor_button = make_icon_button('plus', 'Add new value extractor', self,
                                                      on_clicked=self._do_new_extractor)

        self._how_to_label = QLabel('\u27F5 Click to configure plotting', self)

        widget = QWidget(self)

        layout = QVBoxLayout(widget)
        layout.addWidget(self._plot_area, 1)

        footer_layout = QHBoxLayout(self)

        controls_layout = QVBoxLayout(widget)
        controls_layout.addWidget(self._new_extractor_button)
        controls_layout.addStretch(1)
        controls_layout.setContentsMargins(0, 0, 0, 0)
        footer_layout.addLayout(controls_layout)
        footer_layout.addWidget(self._how_to_label)

        self._extractors_layout = QVBoxLayout(widget)
        self._extractors_layout.setContentsMargins(0, 0, 0, 0)
        footer_layout.addLayout(self._extractors_layout, 1)

        footer_layout.setContentsMargins(0, 0, 0, 0)
        layout.addLayout(footer_layout)
        widget.setLayout(layout)

        self.setWidget(widget)
        self.setFeatures(QDockWidget.DockWidgetFloatable |
                         QDockWidget.DockWidgetClosable |
                         QDockWidget.DockWidgetMovable)

        self.setMinimumWidth(700)
        self.setMinimumHeight(400)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号