コード例 #1
0
    def _create_tabs(self):
        """
        Create widgets (graph, grid and table) for the view and return
        the tabs that contain them.
        """

        # Create the grid.
        self._grid = Grid(self._settings)
        self._grid_checkbox = QtGui.QCheckBox("Only show current measurement")
        self._grid_checkbox.stateChanged.connect(self._grid.toggle)

        grid_layout = QtGui.QVBoxLayout()
        grid_layout.addWidget(self._grid_checkbox)
        grid_layout.addWidget(self._grid)
        grid_widget = QtGui.QWidget()
        grid_widget.setLayout(grid_layout)

        # Create the graph and table.
        self._graph = Graph(self._settings)
        self._table = Table(self._settings)

        # Create the top tabs.
        top_tabs = QtGui.QTabWidget()
        top_tabs.addTab(self._canvas, "Image")
        top_tabs.addTab(grid_widget, "Grid")

        # Create the bottom tabs.
        bottom_tabs = QtGui.QTabWidget()
        bottom_tabs.addTab(self._graph.create(), "Graph")
        bottom_tabs.addTab(self._table.create(), "Table")

        return top_tabs, bottom_tabs
コード例 #2
0
    def _create_grid(self):
        grid = Grid(size=self._plot_width)
        grid.setup(self._runner.problem.network_size)

        return grid