Python PySide2.QtWidgets.QSpinBox() Examples

The following are 6 code examples of PySide2.QtWidgets.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 PySide2.QtWidgets , or try the search function .
Example #1
Source File: ToolBox.py    From PyAero with MIT License 5 votes vote down vote up
def itemAeropython(self):

        form = QtWidgets.QFormLayout()

        label1 = QtWidgets.QLabel(u'Angle of attack (°)')
        self.aoa = QtWidgets.QDoubleSpinBox()
        self.aoa.setSingleStep(0.1)
        self.aoa.setDecimals(1)
        self.aoa.setRange(-10.0, 10.0)
        self.aoa.setValue(0.0)
        form.addRow(label1, self.aoa)

        label2 = QtWidgets.QLabel('Freestream velocity (m/s)')
        self.freestream = QtWidgets.QDoubleSpinBox()
        self.freestream.setSingleStep(0.1)
        self.freestream.setDecimals(2)
        self.freestream.setRange(0.0, 100.0)
        self.freestream.setValue(10.0)
        form.addRow(label2, self.freestream)

        label3 = QtWidgets.QLabel('Number of panels (-)')
        self.panels = QtWidgets.QSpinBox()
        self.panels.setRange(10, 500)
        self.panels.setValue(40)
        form.addRow(label3, self.panels)

        panelMethodButton = QtWidgets.QPushButton('Calculate lift coefficient')
        form.addRow(panelMethodButton)

        self.item_ap = QtWidgets.QGroupBox('AeroPython Panel Method')
        self.item_ap.setLayout(form)

        panelMethodButton.clicked.connect(self.runPanelMethod) 
Example #2
Source File: onionSkinRendererWindow.py    From onionSkinRenderer with MIT License 5 votes vote down vote up
def addAbsoluteFrameFromSpinbox(self):
        frame = self.sender().parent().findChild(QtWidgets.QSpinBox, 'absolute_add_spinBox').value()
        self.addAbsoluteFrame(frame = frame)

    # 
Example #3
Source File: custom_spin_box.py    From randovania with GNU General Public License v3.0 5 votes vote down vote up
def eventFilter(self, obj: QSpinBox, event: QEvent) -> bool:
        if event.type() == QEvent.Wheel and isinstance(obj, QSpinBox):
            if obj.focusPolicy() == Qt.WheelFocus:
                event.accept()
                return False
            else:
                event.ignore()
                return True
        return super().eventFilter(obj, event) 
Example #4
Source File: _blockchain_dock.py    From torba with MIT License 4 votes vote down vote up
def setupUi(self, BlockchainDock):
        BlockchainDock.setObjectName("BlockchainDock")
        BlockchainDock.resize(416, 167)
        BlockchainDock.setFloating(False)
        BlockchainDock.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
        self.dockWidgetContents = QtWidgets.QWidget()
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.formLayout = QtWidgets.QFormLayout(self.dockWidgetContents)
        self.formLayout.setObjectName("formLayout")
        self.generate = QtWidgets.QPushButton(self.dockWidgetContents)
        self.generate.setObjectName("generate")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.generate)
        self.blocks = QtWidgets.QSpinBox(self.dockWidgetContents)
        self.blocks.setMinimum(1)
        self.blocks.setMaximum(9999)
        self.blocks.setProperty("value", 1)
        self.blocks.setObjectName("blocks")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.blocks)
        self.transfer = QtWidgets.QPushButton(self.dockWidgetContents)
        self.transfer.setObjectName("transfer")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.transfer)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.amount = QtWidgets.QDoubleSpinBox(self.dockWidgetContents)
        self.amount.setSuffix("")
        self.amount.setMaximum(9999.99)
        self.amount.setProperty("value", 10.0)
        self.amount.setObjectName("amount")
        self.horizontalLayout.addWidget(self.amount)
        self.to_label = QtWidgets.QLabel(self.dockWidgetContents)
        self.to_label.setObjectName("to_label")
        self.horizontalLayout.addWidget(self.to_label)
        self.address = QtWidgets.QLineEdit(self.dockWidgetContents)
        self.address.setObjectName("address")
        self.horizontalLayout.addWidget(self.address)
        self.formLayout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout)
        self.invalidate = QtWidgets.QPushButton(self.dockWidgetContents)
        self.invalidate.setObjectName("invalidate")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.invalidate)
        self.block_hash = QtWidgets.QLineEdit(self.dockWidgetContents)
        self.block_hash.setObjectName("block_hash")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.block_hash)
        BlockchainDock.setWidget(self.dockWidgetContents)

        self.retranslateUi(BlockchainDock)
        QtCore.QMetaObject.connectSlotsByName(BlockchainDock) 
Example #5
Source File: onionSkinRendererPreferences.py    From onionSkinRenderer with MIT License 4 votes vote down vote up
def setupUi(self, onionSkinRendererPreferences):
        onionSkinRendererPreferences.setObjectName("onionSkinRendererPreferences")
        onionSkinRendererPreferences.resize(279, 157)
        self.verticalLayout = QtWidgets.QVBoxLayout(onionSkinRendererPreferences)
        self.verticalLayout.setObjectName("verticalLayout")
        self.prefs_maxBuffer_layout = QtWidgets.QHBoxLayout()
        self.prefs_maxBuffer_layout.setObjectName("prefs_maxBuffer_layout")
        self.maxBuffer_label = QtWidgets.QLabel(onionSkinRendererPreferences)
        self.maxBuffer_label.setObjectName("maxBuffer_label")
        self.prefs_maxBuffer_layout.addWidget(self.maxBuffer_label)
        self.maxBuffer_spinBox = QtWidgets.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 = QtWidgets.QHBoxLayout()
        self.prefs_relativeKeyCount_layout.setObjectName("prefs_relativeKeyCount_layout")
        self.relativeKeyCount_label = QtWidgets.QLabel(onionSkinRendererPreferences)
        self.relativeKeyCount_label.setObjectName("relativeKeyCount_label")
        self.prefs_relativeKeyCount_layout.addWidget(self.relativeKeyCount_label)
        self.relativeKeyCount_spinBox = QtWidgets.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_outlineWidth = QtWidgets.QHBoxLayout()
        self.prefs_outlineWidth.setObjectName("prefs_outlineWidth")
        self.outlineWidth_label = QtWidgets.QLabel(onionSkinRendererPreferences)
        self.outlineWidth_label.setObjectName("outlineWidth_label")
        self.prefs_outlineWidth.addWidget(self.outlineWidth_label)
        self.outlineWidth_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
        self.outlineWidth_spinBox.setMinimum(1)
        self.outlineWidth_spinBox.setMaximum(512)
        self.outlineWidth_spinBox.setProperty("value", 3)
        self.outlineWidth_spinBox.setObjectName("outlineWidth_spinBox")
        self.prefs_outlineWidth.addWidget(self.outlineWidth_spinBox)
        self.verticalLayout.addLayout(self.prefs_outlineWidth)
        self.prefs_tintSeed = QtWidgets.QHBoxLayout()
        self.prefs_tintSeed.setObjectName("prefs_tintSeed")
        self.tintSeed_label = QtWidgets.QLabel(onionSkinRendererPreferences)
        self.tintSeed_label.setObjectName("tintSeed_label")
        self.prefs_tintSeed.addWidget(self.tintSeed_label)
        self.tintSeed_spinBox = QtWidgets.QSpinBox(onionSkinRendererPreferences)
        self.tintSeed_spinBox.setObjectName("tintSeed_spinBox")
        self.prefs_tintSeed.addWidget(self.tintSeed_spinBox)
        self.verticalLayout.addLayout(self.prefs_tintSeed)
        self.prefs_dialogButtonBox = QtWidgets.QDialogButtonBox(onionSkinRendererPreferences)
        self.prefs_dialogButtonBox.setOrientation(QtCore.Qt.Horizontal)
        self.prefs_dialogButtonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.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 #6
Source File: GeneralDialogues.py    From GridCal with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self):
        super(NewProfilesStructureDialogue, self).__init__()
        self.setObjectName("self")
        # self.resize(200, 71)
        # self.setMinimumSize(QtCore.QSize(200, 71))
        # self.setMaximumSize(QtCore.QSize(200, 71))
        self.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
        # icon = QtGui.QIcon()
        # icon.addPixmap(QtGui.QPixmap("Icons/Plus-32.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        # self.setWindowIcon(icon)
        self.layout = QtWidgets.QVBoxLayout(self)

        # calendar
        self.calendar = QtWidgets.QDateTimeEdit()
        d = datetime.today()
        self.calendar.setDateTime(QtCore.QDateTime(d.year, 1, 1, 00, 00, 00))

        # number of time steps
        self.steps_spinner = QtWidgets.QSpinBox()
        self.steps_spinner.setMinimum(1)
        self.steps_spinner.setMaximum(9999999)
        self.steps_spinner.setValue(1)

        # time step length
        self.step_length = QtWidgets.QDoubleSpinBox()
        self.step_length.setMinimum(1)
        self.step_length.setMaximum(60)
        self.step_length.setValue(1)

        # units combo box
        self.units = QtWidgets.QComboBox()
        self.units.setModel(get_list_model(['h', 'm', 's']))

        # accept button
        self.accept_btn = QtWidgets.QPushButton()
        self.accept_btn.setText('Accept')
        self.accept_btn.clicked.connect(self.accept_click)

        # labels

        # add all to the GUI
        self.layout.addWidget(QtWidgets.QLabel("Start date"))
        self.layout.addWidget(self.calendar)

        self.layout.addWidget(QtWidgets.QLabel("Number of time steps"))
        self.layout.addWidget(self.steps_spinner)

        self.layout.addWidget(QtWidgets.QLabel("Time step length"))
        self.layout.addWidget(self.step_length)

        self.layout.addWidget(QtWidgets.QLabel("Time units"))
        self.layout.addWidget(self.units)

        self.layout.addWidget(self.accept_btn)

        self.setLayout(self.layout)

        self.setWindowTitle('New profiles structure')