Exemple #1
0
    def initUI(self):
        # Create some widgets (these won't appear immediately):
        self.leftWidget = QWidget()
        self.pointsCombobox = QComboBox()
        self.pointsCombobox.setFocusPolicy(Qt.NoFocus)
        self.pointsCombobox.currentIndexChanged.connect(self.datasetChanged)
        self.leftWidget.setLayout(QFormLayout())
        self.leftWidget.layout().addRow("Point sets", self.pointsCombobox)
        self.addSlider(self.leftWidget.layout(),
                       text="Point Size",
                       max=15,
                       callback=self.update_point_size)
        cDialog = QColorDialog(self)
        cDialog.currentColorChanged.connect(self.update_color)
        cDialog.setWindowFlags(Qt.Widget)
        cDialog.setOptions(QColorDialog.DontUseNativeDialog
                           | QColorDialog.NoButtons)
        cDialog.setFocusPolicy(Qt.NoFocus)
        self.leftWidget.layout().addRow(cDialog)

        self.leftWidget.setFixedWidth(600)
        self.mywidget = Window(data_filepath=None)

        # Put the widgets in a layout (now they start to appear):
        layout = QGridLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.mywidget, 0, 1)
        layout.addWidget(self.leftWidget, 0, 0)
        self.widget.setLayout(layout)