Python PySide.QtGui.QSpinBox() Examples

The following are 18 code examples of PySide.QtGui.QSpinBox(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtGui , or try the search function .
Example #1
Source File: ScatterPlotSpeedTestTemplate_pyside.py    From tf-pose with Apache License 2.0 6 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.sizeSpin = QtGui.QSpinBox(Form)
        self.sizeSpin.setProperty("value", 10)
        self.sizeSpin.setObjectName("sizeSpin")
        self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.pixelModeCheck = QtGui.QCheckBox(Form)
        self.pixelModeCheck.setObjectName("pixelModeCheck")
        self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.plot = PlotWidget(Form)
        self.plot.setObjectName("plot")
        self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
        self.randCheck = QtGui.QCheckBox(Form)
        self.randCheck.setObjectName("randCheck")
        self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #2
Source File: ScatterPlotSpeedTestTemplate_pyside.py    From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 6 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.sizeSpin = QtGui.QSpinBox(Form)
        self.sizeSpin.setProperty("value", 10)
        self.sizeSpin.setObjectName("sizeSpin")
        self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.pixelModeCheck = QtGui.QCheckBox(Form)
        self.pixelModeCheck.setObjectName("pixelModeCheck")
        self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.plot = PlotWidget(Form)
        self.plot.setObjectName("plot")
        self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
        self.randCheck = QtGui.QCheckBox(Form)
        self.randCheck.setObjectName("randCheck")
        self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #3
Source File: options.py    From dpa-pipe with MIT License 5 votes vote down vote up
def __init__(self, name, config, parent=None):
        
        ActionOptionNumeric.__init__(self, name, config)
        QtGui.QSpinBox.__init__(self, parent=parent)

        self.setMaximum(int(self.max))
        self.setMinimum(int(self.min))
        self.setSingleStep(int(self.step))

        self.setToolTip(self.tooltip)
        self.setValue(int(self.default))

        self.valueChanged.connect(lambda v: self.value_changed.emit())

    # ------------------------------------------------------------------------- 
Example #4
Source File: options.py    From dpa-pipe with MIT License 5 votes vote down vote up
def value(self):
        return QtGui.QSpinBox.value(self)

# ----------------------------------------------------------------------------- 
Example #5
Source File: vfpfunc.py    From vfp2py with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
            QtGui.QSpinBox.__init__(self)
            Custom.__init__(self, *args, **kwargs)
            self.pressed = False
            self.installEventFilter(self)
            self.valueChanged.connect(self.interactivechange) 
Example #6
Source File: vfpfunc.py    From vfp2py with MIT License 5 votes vote down vote up
def value(self):
            return QtGui.QSpinBox.value(self) 
Example #7
Source File: onionSkinRendererPreferences.py    From onionSkinRenderer with MIT License 5 votes vote down vote up
def setupUi(self, onionSkinRendererPreferences):
        onionSkinRendererPreferences.setObjectName("onionSkinRendererPreferences")
        onionSkinRendererPreferences.resize(280, 97)
        self.verticalLayout = QtGui.QVBoxLayout(onionSkinRendererPreferences)
        self.verticalLayout.setObjectName("verticalLayout")
        self.prefs_maxBuffer_layout = QtGui.QHBoxLayout()
        self.prefs_maxBuffer_layout.setObjectName("prefs_maxBuffer_layout")
        self.maxBuffer_label = QtGui.QLabel(onionSkinRendererPreferences)
        self.maxBuffer_label.setObjectName("maxBuffer_label")
        self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_label)
        self.maxBuffer_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences)
        self.maxBuffer_spinBox.setMinimum(1)
        self.maxBuffer_spinBox.setMaximum(10000)
        self.maxBuffer_spinBox.setProperty("value", 200)
        self.maxBuffer_spinBox.setObjectName("maxBuffer_spinBox")
        self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_spinBox)
        self.verticalLayout.addLayout(self.prefs_maxBuffer_layout)
        self.prefs_relativeKeyCount_layout = QtGui.QHBoxLayout()
        self.prefs_relativeKeyCount_layout.setObjectName("prefs_relativeKeyCount_layout")
        self.relativeKeyCount_label = QtGui.QLabel(onionSkinRendererPreferences)
        self.relativeKeyCount_label.setObjectName("relativeKeyCount_label")
        self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_label)
        self.relativeKeyCount_spinBox = QtGui.QSpinBox(onionSkinRendererPreferences)
        self.relativeKeyCount_spinBox.setMinimum(1)
        self.relativeKeyCount_spinBox.setMaximum(10)
        self.relativeKeyCount_spinBox.setProperty("value", 4)
        self.relativeKeyCount_spinBox.setObjectName("relativeKeyCount_spinBox")
        self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_spinBox)
        self.verticalLayout.addLayout(self.prefs_relativeKeyCount_layout)
        self.prefs_dialogButtonBox = QtGui.QDialogButtonBox(onionSkinRendererPreferences)
        self.prefs_dialogButtonBox.setOrientation(QtCore.Qt.Horizontal)
        self.prefs_dialogButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.prefs_dialogButtonBox.setObjectName("prefs_dialogButtonBox")
        self.verticalLayout.addWidget(self.prefs_dialogButtonBox)

        self.retranslateUi(onionSkinRendererPreferences)
        QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("accepted()"), onionSkinRendererPreferences.accept)
        QtCore.QObject.connect(self.prefs_dialogButtonBox, QtCore.SIGNAL("rejected()"), onionSkinRendererPreferences.reject)
        QtCore.QMetaObject.connectSlotsByName(onionSkinRendererPreferences) 
Example #8
Source File: onionSkinRendererWindow.py    From onionSkinRenderer with MIT License 5 votes vote down vote up
def addAbsoluteFrameFromSpinbox(self):
        frame = self.sender().parent().findChild(QtGui.QSpinBox, 'absolute_add_spinBox').value()
        self.addAbsoluteFrame(frame = frame)

    # 
Example #9
Source File: axisCtrlTemplate_pyside.py    From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 4 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(186, 154)
        Form.setMaximumSize(QtCore.QSize(200, 16777215))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
        self.linkCombo = QtGui.QComboBox(Form)
        self.linkCombo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.linkCombo.setObjectName("linkCombo")
        self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
        self.autoPercentSpin = QtGui.QSpinBox(Form)
        self.autoPercentSpin.setEnabled(True)
        self.autoPercentSpin.setMinimum(1)
        self.autoPercentSpin.setMaximum(100)
        self.autoPercentSpin.setSingleStep(1)
        self.autoPercentSpin.setProperty("value", 100)
        self.autoPercentSpin.setObjectName("autoPercentSpin")
        self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
        self.autoRadio = QtGui.QRadioButton(Form)
        self.autoRadio.setChecked(True)
        self.autoRadio.setObjectName("autoRadio")
        self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
        self.manualRadio = QtGui.QRadioButton(Form)
        self.manualRadio.setObjectName("manualRadio")
        self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
        self.minText = QtGui.QLineEdit(Form)
        self.minText.setObjectName("minText")
        self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
        self.maxText = QtGui.QLineEdit(Form)
        self.maxText.setObjectName("maxText")
        self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
        self.invertCheck = QtGui.QCheckBox(Form)
        self.invertCheck.setObjectName("invertCheck")
        self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
        self.mouseCheck = QtGui.QCheckBox(Form)
        self.mouseCheck.setChecked(True)
        self.mouseCheck.setObjectName("mouseCheck")
        self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
        self.visibleOnlyCheck = QtGui.QCheckBox(Form)
        self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
        self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
        self.autoPanCheck = QtGui.QCheckBox(Form)
        self.autoPanCheck.setObjectName("autoPanCheck")
        self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #10
Source File: gui.py    From epycyzm with MIT License 4 votes vote down vote up
def createMessageGroupBox(self):
        self.messageGroupBox = QtGui.QGroupBox("Balloon Message")

        typeLabel = QtGui.QLabel("Type:")

        self.typeComboBox = QtGui.QComboBox()
        self.typeComboBox.addItem("None", QtGui.QSystemTrayIcon.NoIcon)
        self.typeComboBox.addItem(self.style().standardIcon(
                QtGui.QStyle.SP_MessageBoxInformation), "Information",
                QtGui.QSystemTrayIcon.Information)
        self.typeComboBox.addItem(self.style().standardIcon(
                QtGui.QStyle.SP_MessageBoxWarning), "Warning",
                QtGui.QSystemTrayIcon.Warning)
        self.typeComboBox.addItem(self.style().standardIcon(
                QtGui.QStyle.SP_MessageBoxCritical), "Critical",
                QtGui.QSystemTrayIcon.Critical)
        self.typeComboBox.setCurrentIndex(1)

        self.durationLabel = QtGui.QLabel("Duration:")

        self.durationSpinBox = QtGui.QSpinBox()
        self.durationSpinBox.setRange(5, 60)
        self.durationSpinBox.setSuffix(" s")
        self.durationSpinBox.setValue(15)

        durationWarningLabel = QtGui.QLabel("(some systems might ignore this "
                "hint)")
        durationWarningLabel.setIndent(10)

        titleLabel = QtGui.QLabel("Title:")

        self.titleEdit = QtGui.QLineEdit("Cannot connect to network")

        bodyLabel = QtGui.QLabel("Body:")

        self.bodyEdit = QtGui.QTextEdit()
        self.bodyEdit.setPlainText("Don't believe me. Honestly, I don't have "
                "a clue.\nClick this balloon for details.")

        self.showMessageButton = QtGui.QPushButton("Show Message")
        self.showMessageButton.setDefault(True)

        messageLayout = QtGui.QGridLayout()
        messageLayout.addWidget(typeLabel, 0, 0)
        messageLayout.addWidget(self.typeComboBox, 0, 1, 1, 2)
        messageLayout.addWidget(self.durationLabel, 1, 0)
        messageLayout.addWidget(self.durationSpinBox, 1, 1)
        messageLayout.addWidget(durationWarningLabel, 1, 2, 1, 3)
        messageLayout.addWidget(titleLabel, 2, 0)
        messageLayout.addWidget(self.titleEdit, 2, 1, 1, 4)
        messageLayout.addWidget(bodyLabel, 3, 0)
        messageLayout.addWidget(self.bodyEdit, 3, 1, 2, 4)
        messageLayout.addWidget(self.showMessageButton, 5, 4)
        messageLayout.setColumnStretch(3, 1)
        messageLayout.setRowStretch(4, 1)
        self.messageGroupBox.setLayout(messageLayout) 
Example #11
Source File: axisCtrlTemplate_pyside.py    From soapy with GNU General Public License v3.0 4 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(186, 154)
        Form.setMaximumSize(QtCore.QSize(200, 16777215))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
        self.linkCombo = QtGui.QComboBox(Form)
        self.linkCombo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.linkCombo.setObjectName("linkCombo")
        self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
        self.autoPercentSpin = QtGui.QSpinBox(Form)
        self.autoPercentSpin.setEnabled(True)
        self.autoPercentSpin.setMinimum(1)
        self.autoPercentSpin.setMaximum(100)
        self.autoPercentSpin.setSingleStep(1)
        self.autoPercentSpin.setProperty("value", 100)
        self.autoPercentSpin.setObjectName("autoPercentSpin")
        self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
        self.autoRadio = QtGui.QRadioButton(Form)
        self.autoRadio.setChecked(True)
        self.autoRadio.setObjectName("autoRadio")
        self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
        self.manualRadio = QtGui.QRadioButton(Form)
        self.manualRadio.setObjectName("manualRadio")
        self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
        self.minText = QtGui.QLineEdit(Form)
        self.minText.setObjectName("minText")
        self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
        self.maxText = QtGui.QLineEdit(Form)
        self.maxText.setObjectName("maxText")
        self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
        self.invertCheck = QtGui.QCheckBox(Form)
        self.invertCheck.setObjectName("invertCheck")
        self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
        self.mouseCheck = QtGui.QCheckBox(Form)
        self.mouseCheck.setChecked(True)
        self.mouseCheck.setObjectName("mouseCheck")
        self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
        self.visibleOnlyCheck = QtGui.QCheckBox(Form)
        self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
        self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
        self.autoPanCheck = QtGui.QCheckBox(Form)
        self.autoPanCheck.setObjectName("autoPanCheck")
        self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #12
Source File: grid.py    From FreeCAD_drawing_dimensioning with GNU Lesser General Public License v2.1 4 votes vote down vote up
def generateWidget(self, dimensioningProcess):
        self.dimensioningProcess = dimensioningProcess
        groupbox = QtGui.QGroupBox("Grid Options")
        groupbox.setCheckable( True ) 
        groupbox.toggled.connect( self.groupBoxToggled )
        self.groupbox = groupbox
        checked = self.dd_parms.GetBool("show_grid_options",True)
        groupbox.setChecked(checked)
        vbox = QtGui.QVBoxLayout()

        gridOn_checkbox = QtGui.QCheckBox('grid on')
        gridOn_checkbox.setChecked( self.dd_parms.GetBool( 'grid_on', False ))
        gridOn_checkbox.stateChanged.connect( self.gridOn_checkbox_stateChanged )
        vbox.addWidget( gridOn_checkbox )
        self.gridOn_checkbox =  gridOn_checkbox

        spacingSpinbox = QtGui.QDoubleSpinBox()
        spacingSpinbox.setValue( self.dd_parms.GetFloat( 'grid_spacing', default_grid_spacing )  )
        spacingSpinbox.setMinimum( 0.01 )
        spacingSpinbox.setDecimals( 2 )
        spacingSpinbox.setSingleStep( 0.5 )
        spacingSpinbox.setSuffix('mm')
        spacingSpinbox.valueChanged.connect( self.spacingSpinbox_valueChanged )
        vbox.addLayout( DimensioningTaskDialog_generate_row_hbox('spacing', spacingSpinbox) )
        self.spacingSpinbox = spacingSpinbox

        displayPeriodSpinbox = QtGui.QSpinBox()
        displayPeriodSpinbox.setValue( min( self.dd_parms.GetInt( 'grid_display_period', default_grid_display_period  ), 200)  )
        displayPeriodSpinbox.setMinimum( 0 )
        displayPeriodSpinbox.valueChanged.connect( self.displayPeriodSpinbox_valueChanged )
        vbox.addLayout( DimensioningTaskDialog_generate_row_hbox('display period', displayPeriodSpinbox) )
        self.displayPeriodSpinbox = displayPeriodSpinbox

        clr = QtGui.QColor(*unsignedToRGB(self.dd_parms.GetUnsigned( 'grid_color', default_grid_clr )) )
        graphicsScene = QtGui.QGraphicsScene(0,0,30,30)
        pen = QtGui.QPen( QtGui.QColor(0,0,0,0) )
        pen.setWidth(0.0)
        rect = ClickRect(-100, -100, 200, 200)
        rect.setPen(pen)
        rect.clickFun = self.specifyNewGridColor
        graphicsScene.addItem(rect) 
        self.graphicsScene = graphicsScene #protect from garbage collector
        self.colorRect = rect
        self.colorRect.setBrush( QtGui.QBrush( clr ) )
        colorBox = QtGui.QGraphicsView( self.graphicsScene )
        colorBox.setMaximumWidth( 60 )
        colorBox.setMaximumHeight( 30 )
        colorBox.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff )
        colorBox.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff )
        vbox.addLayout(  DimensioningTaskDialog_generate_row_hbox( 'color', colorBox ) )

        lineWidthSpinbox = QtGui.QDoubleSpinBox()
        lineWidthSpinbox.setValue( self.dd_parms.GetFloat( 'grid_line_width', default_grid_line_width )  )
        lineWidthSpinbox.setMinimum( 0. )
        lineWidthSpinbox.setDecimals( 2 )
        lineWidthSpinbox.setSingleStep( 0.05 )
        lineWidthSpinbox.valueChanged.connect( self.lineWidthSpinbox_valueChanged )
        vbox.addLayout( DimensioningTaskDialog_generate_row_hbox('lineWidth', lineWidthSpinbox) )
        self.lineWidthSpinbox = lineWidthSpinbox
        groupbox.setLayout(vbox)
        return groupbox 
Example #13
Source File: FilterTab.py    From CANalyzat0r with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, tabWidget):
        AbstractTab.__init__(
            self,
            tabWidget,
            Strings.filterTabLoggerName, [0, 1, 2, 3, 4],
            Strings.filterTabPacketTableViewName,
            Strings.filterTabLabelInterfaceValueName,
            allowTablePaste=False)

        #: Noise that will be substracted from the collected data
        self.noiseData = []

        self.snifferProcess = None
        self.dataAdderThread = None

        #: Shared process independent flag to terminate the sniffer process
        self.sharedSnifferEnabledFlag = Value("i", 1)
        #: Shared process independent flag to terminate the data adder
        self.sharedDataAdderEnabledFlag = Value("i", 1)

        # Get all GUI elements
        self.spinBoxFilterTimeCollectNoise = self.tabWidget.findChild(
            QtGui.QSpinBox, "spinBoxFilterTimeCollectNoise")
        self.spinBoxFilterSampleAmount = self.tabWidget.findChild(
            QtGui.QSpinBox, "spinBoxFilterSampleAmount")
        self.buttonFilterInterfaceSettings = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonFilterInterfaceSettings")
        self.buttonFilterStart = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonFilterStart")
        self.buttonFilterDataClear = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonFilterDataClear")

        assert all(GUIElem is not None for GUIElem in [
            self.spinBoxFilterTimeCollectNoise, self.spinBoxFilterSampleAmount,
            self.buttonFilterInterfaceSettings, self.buttonFilterStart, self.
            buttonFilterDataClear
        ]), "GUI Elements not found"

        self.buttonFilterInterfaceSettings.clicked.connect(
            self.handleInterfaceSettingsDialog)
        self.buttonFilterStart.clicked.connect(self.startFilter)
        self.buttonFilterDataClear.clicked.connect(self.clear)

        self.prepareUI() 
Example #14
Source File: gui.py    From autopilot with Mozilla Public License 2.0 4 votes vote down vote up
def __init__(self):
            QtGui.QWidget.__init__(self)

            # Input Labels
            ID_label = QtGui.QLabel("ID:")
            start_label = QtGui.QLabel("Start Date:")
            blmass_label = QtGui.QLabel("Baseline Mass:")
            minmasspct_label = QtGui.QLabel("% of Baseline Mass:")
            minmass_label = QtGui.QLabel("Minimum Mass:")
            genotype_label = QtGui.QLabel("Genotype:")
            expt_label = QtGui.QLabel("Experiment Tag:")

            # Input widgets
            self.id = QtGui.QLineEdit()
            self.start_date = QtGui.QLineEdit(datetime.date.today().isoformat())
            self.blmass = QtGui.QLineEdit()
            self.blmass.setValidator(QtGui.QDoubleValidator(0.0, 30.0, 1, self.blmass))
            self.minmass_pct = QtGui.QSpinBox()
            self.minmass_pct.setRange(0,100)
            self.minmass_pct.setSingleStep(5)
            self.minmass_pct.setSuffix('%')
            self.minmass_pct.setValue(80)
            self.minmass = QtGui.QLineEdit()
            self.minmass.setValidator(QtGui.QDoubleValidator(0.0, 30.0, 1, self.minmass))
            self.genotype = QtGui.QLineEdit()
            self.expt     = QtGui.QLineEdit()

            # Set return dictionary signals
            self.id.editingFinished.connect(lambda: self.update_return_dict('id', self.id.text()))
            self.start_date.editingFinished.connect(lambda: self.update_return_dict('start_date', self.start_date.text()))
            self.blmass.editingFinished.connect(lambda: self.update_return_dict('baseline_mass', self.blmass.text()))
            self.minmass.editingFinished.connect(lambda: self.update_return_dict('min_mass', self.minmass.text()))
            self.genotype.editingFinished.connect(lambda: self.update_return_dict('genotype', self.genotype.text()))
            self.expt.editingFinished.connect(lambda: self.update_return_dict('experiment', self.expt.text()))

            # Set update minmass signals
            self.blmass.editingFinished.connect(self.calc_minmass)
            self.minmass_pct.valueChanged.connect(self.calc_minmass)

            # Setup Layout
            mainLayout = QtGui.QVBoxLayout()
            mainLayout.addWidget(ID_label)
            mainLayout.addWidget(self.id)
            mainLayout.addWidget(start_label)
            mainLayout.addWidget(self.start_date)
            mainLayout.addWidget(blmass_label)
            mainLayout.addWidget(self.blmass)
            mainLayout.addWidget(minmasspct_label)
            mainLayout.addWidget(self.minmass_pct)
            mainLayout.addWidget(minmass_label)
            mainLayout.addWidget(self.minmass)
            mainLayout.addWidget(genotype_label)
            mainLayout.addWidget(self.genotype)
            mainLayout.addWidget(expt_label)
            mainLayout.addWidget(self.expt)
            mainLayout.addStretch(1)

            self.setLayout(mainLayout)

            # Dictionary to return values
            self.values = {} 
Example #15
Source File: SettingsDialog.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 4 votes vote down vote up
def initUI(self):
        fontSize = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetInt("fontSize")
        keybinding = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetString("executeKeybinding")
        executeOnSave = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("executeOnSave")
        showLineNumbers = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("showLineNumbers")
        allowReload = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/cadquery-freecad-module").GetBool("allowReload")

        font_size = QtGui.QLabel('Font Size')
        self.ui_font_size = QtGui.QSpinBox()
        self.ui_font_size.setValue(fontSize)

        key_binding = QtGui.QLabel('Execute Key-binding')
        self.ui_key_binding = QtGui.QLineEdit()
        self.ui_key_binding.setText(keybinding)

        execute_on_save = QtGui.QLabel('Execute on Save')
        self.execute_on_save = QtGui.QCheckBox()
        self.execute_on_save.setChecked(executeOnSave)

        show_line_numbers = QtGui.QLabel('Show Line Numbers')
        self.show_line_numbers = QtGui.QCheckBox()
        self.show_line_numbers.setChecked(showLineNumbers)

        allow_reload = QtGui.QLabel('Allow Reload')
        self.allow_reload = QtGui.QCheckBox()
        self.allow_reload.setChecked(allowReload)

        self.buttons = QtGui.QDialogButtonBox();
        self.buttons.setOrientation(QtCore.Qt.Horizontal)
        self.buttons.setStandardButtons(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)
        self.buttons.layout().setDirection(QtGui.QBoxLayout.LeftToRight)
        self.buttons.accepted.connect(self.acceptSettings)
        self.buttons.rejected.connect(self.reject)

        grid = QtGui.QGridLayout()
        grid.setContentsMargins(10, 10, 10, 10)
        grid.addWidget(font_size, 0, 0)
        grid.addWidget(self.ui_font_size, 0, 1)
        grid.addWidget(key_binding, 1, 0)
        grid.addWidget(self.ui_key_binding, 1, 1)
        grid.addWidget(execute_on_save, 2, 0)
        grid.addWidget(self.execute_on_save, 2, 1)
        grid.addWidget(show_line_numbers, 3, 0)
        grid.addWidget(self.show_line_numbers, 3, 1)
        grid.addWidget(allow_reload, 4, 0)
        grid.addWidget(self.allow_reload, 4, 1)
        grid.addWidget(self.buttons, 5, 1)

        self.setLayout(grid) 
Example #16
Source File: scroll_gui.py    From FRETBursts with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, fig, plot_fun, *args, **kwargs):
        if 'bins' not in kwargs: kwargs.update(bins=np.r_[:10:0.02])
        if 't_max' not in kwargs: kwargs.update(t_max=-1)

        # Save some variables
        self.fig = fig
        self.AX = kwargs['AX']
        self.plot_fun = plot_fun
        self.f_args = args
        self.f_kwargs = kwargs
        self.time_max = args[0].time_max()

        # Some handy shortcut
        self.draw = self.fig.canvas.draw

        # Create the spinboxes for setting the range
        mlabel = QtGui.QLabel()
        mlabel.setText("m:")
        self.m_spinbox = QtGui.QSpinBox()
        self.m_spinbox.setRange(2,500)
        self.m_spinbox.setKeyboardTracking(False)
        self.m_spinbox.setValue(self.f_kwargs['m'])
        self.m_spinbox.valueChanged.connect(self.par_changed)

        blabel = QtGui.QLabel()
        blabel.setText("bin:")
        self.bin_spinbox = QtGui.QDoubleSpinBox()
        self.bin_spinbox.setRange(1e-6,1e6)
        self.bin_spinbox.setDecimals(3)
        self.bin_spinbox.setKeyboardTracking(False)
        bins = self.f_kwargs['bins']
        self.bin_spinbox.setValue(bins[1]-bins[0])
        self.bin_spinbox.valueChanged.connect(self.par_changed)

        tlabel = QtGui.QLabel()
        tlabel.setText("t max (s):")
        self.tmax_spinbox = QtGui.QDoubleSpinBox()
        self.tmax_spinbox.setRange(0,3600)
        self.tmax_spinbox.setKeyboardTracking(False)
        if kwargs['t_max'] <= 0 or kwargs['t_max'] > self.time_max:
            kwargs['t_max'] = self.time_max
        self.tmax_spinbox.setValue(kwargs['t_max'])
        self.tmax_spinbox.valueChanged.connect(self.par_changed)

        addWidget = fig.canvas.toolbar.addWidget
        addWidget(mlabel); addWidget(self.m_spinbox)
        addWidget(blabel); addWidget(self.bin_spinbox)
        addWidget(tlabel); addWidget(self.tmax_spinbox)
        self.draw()
        self.save_params() 
Example #17
Source File: base.py    From dpa-pipe with MIT License 4 votes vote down vote up
def _make_frame_range_controls(self,
        min_time, max_time, start_time, end_time):

        self._frame_start = QtGui.QSpinBox()
        self._frame_start.setMinimum(min_time)
        self._frame_start.setMaximum(max_time)
        self._frame_start.setValue(int(start_time))
        self._frame_start.setFixedWidth(50)

        frame_to = QtGui.QLabel("to")

        self._frame_end = QtGui.QSpinBox()
        self._frame_end.setMinimum(min_time)
        self._frame_end.setMaximum(max_time)
        self._frame_end.setValue(int(end_time))
        self._frame_end.setFixedWidth(50)

        frame_by = QtGui.QLabel("by")

        self._frame_step = QtGui.QSpinBox()
        self._frame_step.setValue(1)
        self._frame_step.setFixedWidth(50)

        auto_frange_layout = QtGui.QHBoxLayout()
        auto_frange_layout.setContentsMargins(0, 0, 0, 0)
        auto_frange_layout.setSpacing(4)
        auto_frange_layout.addWidget(self._frame_start)
        auto_frange_layout.addWidget(frame_to)
        auto_frange_layout.addWidget(self._frame_end)
        auto_frange_layout.addWidget(frame_by)
        auto_frange_layout.addWidget(self._frame_step)

        auto_frange = QtGui.QWidget()
        auto_frange.setLayout(auto_frange_layout)

        self._manual_frange = QtGui.QLineEdit(
            str(int(start_time)) + "-" + str(int(end_time)))
        self._manual_frange.setFixedHeight(22)

        self._frange_stack = QtGui.QStackedWidget()
        self._frange_stack.addWidget(auto_frange)
        self._frange_stack.addWidget(self._manual_frange)

        edit_icon_path = IconFactory().disk_path(
            "icon:///images/icons/edit_32x32.png")

        self._frange_btn = QtGui.QPushButton()
        self._frange_btn_size = QtCore.QSize(22, 22)
        self._frange_btn.setFlat(True)
        self._frange_btn.setCheckable(True)
        self._frange_btn.setFixedSize(self._frange_btn_size)
        self._frange_btn.setIcon(QtGui.QIcon(edit_icon_path))
        self._frange_btn.setIconSize(self._frange_btn_size)
        self._frange_btn.toggled.connect(
            lambda c: self._frange_stack.setCurrentIndex(int(c)))

    # ------------------------------------------------------------------------- 
Example #18
Source File: axisCtrlTemplate_pyside.py    From tf-pose with Apache License 2.0 4 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(186, 154)
        Form.setMaximumSize(QtCore.QSize(200, 16777215))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
        self.linkCombo = QtGui.QComboBox(Form)
        self.linkCombo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.linkCombo.setObjectName("linkCombo")
        self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
        self.autoPercentSpin = QtGui.QSpinBox(Form)
        self.autoPercentSpin.setEnabled(True)
        self.autoPercentSpin.setMinimum(1)
        self.autoPercentSpin.setMaximum(100)
        self.autoPercentSpin.setSingleStep(1)
        self.autoPercentSpin.setProperty("value", 100)
        self.autoPercentSpin.setObjectName("autoPercentSpin")
        self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
        self.autoRadio = QtGui.QRadioButton(Form)
        self.autoRadio.setChecked(True)
        self.autoRadio.setObjectName("autoRadio")
        self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
        self.manualRadio = QtGui.QRadioButton(Form)
        self.manualRadio.setObjectName("manualRadio")
        self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
        self.minText = QtGui.QLineEdit(Form)
        self.minText.setObjectName("minText")
        self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
        self.maxText = QtGui.QLineEdit(Form)
        self.maxText.setObjectName("maxText")
        self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
        self.invertCheck = QtGui.QCheckBox(Form)
        self.invertCheck.setObjectName("invertCheck")
        self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
        self.mouseCheck = QtGui.QCheckBox(Form)
        self.mouseCheck.setChecked(True)
        self.mouseCheck.setObjectName("mouseCheck")
        self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
        self.visibleOnlyCheck = QtGui.QCheckBox(Form)
        self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
        self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
        self.autoPanCheck = QtGui.QCheckBox(Form)
        self.autoPanCheck.setObjectName("autoPanCheck")
        self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)