Esempio n. 1
0
    def create_feature_widget(self, coord=0):
        # coord => (channel, feature)
        self.projection = [(0, 0), (0, 1)]

        hbox = QtGui.QHBoxLayout()
        hbox.setSpacing(0)
        # HACK: pyside does not have this function
        if hasattr(hbox, 'setMargin'):
            hbox.setMargin(0)

        # channel selection
        comboBox = QtGui.QComboBox(self)
        comboBox.setEditable(True)
        comboBox.setMaximumWidth(100)
        comboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
        comboBox.addItems(["%d" % i for i in self.channels])
        comboBox.addItems(["Extra %d" % i for i in xrange(self.nextrafet)])
        comboBox.editTextChanged.connect(partial(self.select_channel, coord))
        # comboBox.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.channel_box[coord] = comboBox
        hbox.addWidget(comboBox)

        # create 3 buttons for selecting the feature
        widths = [30] * self.fetdim
        labels = ['PC%d' % i for i in xrange(1, self.fetdim + 1)]

        hbox.addSpacing(10)

        # ensure exclusivity of the group of buttons
        pushButtonGroup = QtGui.QButtonGroup(self)
        for i in xrange(len(labels)):
            # selecting feature i
            pushButton = QtGui.QPushButton(labels[i], self)
            pushButton.setCheckable(True)
            if coord == i:
                pushButton.setChecked(True)
            pushButton.setMaximumSize(QtCore.QSize(widths[i], 20))
            pushButton.clicked.connect(partial(self.select_feature, coord, i))
            pushButtonGroup.addButton(pushButton, i)
            self.feature_buttons[coord][i] = pushButton
            hbox.addWidget(pushButton)

        return hbox
 def minimumSizeHint(self):
     return QtCore.QSize(50, 24)
Esempio n. 3
0
 def maximumSize(self):
     return QtCore.QSize(300, 40)
Esempio n. 4
0
 def sizeHint(self):
     return QtCore.QSize(1200, 800)
Esempio n. 5
0
 def maximumSize(self):
     return QtCore.QSize(2000, 2000)
Esempio n. 6
0
 def sizeHint(self):
     return QtCore.QSize(400, 2000)