Python PyQt5.QtWidgets.QSpinBox() Examples

The following are 30 code examples of PyQt5.QtWidgets.QSpinBox(). These examples are extracted from open source projects. 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 PyQt5.QtWidgets , or try the search function .
Example #1
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: rest_settings_wt.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self):
        super().__init__()

        self.updating_gui_bool = False

        self.toggle_switch = ToggleSwitchWt()
        self.both_qrb = RadioButtonLeft(self.tr("Visual + Audio"))
        self.visual_qrb = RadioButtonMiddle(self.tr("Visual"))
        self.audio_qrb = RadioButtonRight(self.tr("Audio"))
        self.notification_interval_qsb = QtWidgets.QSpinBox()
        self.notif_select_audio_qpb = QtWidgets.QPushButton(self.tr("Select audio"))
        self.notif_volume_qsr = QtWidgets.QSlider()

        self.phrases_qlw = RestActionListWt()

        self._init_ui()
        self._connect_slots_to_signals() 
Example #2
Source Project: ddt4all   Author: cedricp   File: dataeditor.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, dataitem, parent=None):
        super(otherPanel, self).__init__(parent)
        self.setFrameStyle(widgets.QFrame.Sunken)
        self.setFrameShape(widgets.QFrame.Box)
        self.data = dataitem

        layout = widgets.QGridLayout()
        labelnob = widgets.QLabel(_("Number of bytes"))
        lableunit = widgets.QLabel(_("Unit"))

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lableunit, 1, 0)
        layout.setRowStretch(2, 1)

        self.inputnob = widgets.QSpinBox()
        self.inputnob.setRange(1, 10240)
        self.inputtype = widgets.QComboBox()
        self.inputtype.addItem("ASCII")
        self.inputtype.addItem("BCD/HEX")

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputtype, 1, 1)

        self.setLayout(layout)
        self.init() 
Example #3
Source Project: awesometts-anki-addon   Author: AwesomeTTS   File: configurator.py    License: GNU General Public License v3.0 6 votes vote down vote up
def accept(self):
        """Saves state on inputs; rough opposite of show()."""

        for list_view in self.findChildren(QtWidgets.QListView):
            for editor in list_view.findChildren(QtWidgets.QWidget, 'editor'):
                list_view.commitData(editor)  # if an editor is open, save it

        self._addon.config.update({
            widget.objectName(): (
                widget.isChecked() if isinstance(widget, Checkbox)
                else widget.atts_value if isinstance(widget, QtWidgets.QPushButton)
                else widget.value() if isinstance(widget, QtWidgets.QSpinBox)
                else widget.itemData(widget.currentIndex()) if isinstance(
                    widget, QtWidgets.QComboBox)
                else [
                    i for i in widget.model().raw_data
                    if i['compiled'] and 'bad_replace' not in i
                ] if isinstance(widget, QtWidgets.QListView)
                else widget.text()
            )
            for widget in self.findChildren(self._PROPERTY_WIDGETS)
            if widget.objectName() in self._PROPERTY_KEYS
        })

        super(Configurator, self).accept() 
Example #4
Source Project: Miyamoto   Author: aboood40091   File: puzzle.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self):
        super().__init__()

        self.setVisible(False)

        layout = QtWidgets.QHBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0,0,0,0)

        spinbox1 = QtWidgets.QSpinBox()
        spinbox1.setFixedSize(32, 24)
        spinbox1.valueChanged.connect(self.startValChanged)
        layout.addWidget(spinbox1)

        spinbox2 = QtWidgets.QSpinBox()
        spinbox2.setFixedSize(32, 24)
        spinbox2.valueChanged.connect(self.endValChanged)
        layout.addWidget(spinbox2)

        self.spinboxes = (spinbox1, spinbox2)
        self.updating = False

        self.setFixedWidth(64) 
Example #5
Source Project: Miyamoto   Author: aboood40091   File: puzzle.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self):
        super().__init__()

        self.setVisible(False)

        layout = QtWidgets.QHBoxLayout(self)
        layout.setSpacing(0)
        layout.setContentsMargins(0,0,0,0)

        self.spinbox = QtWidgets.QSpinBox()
        self.spinbox.setFixedSize(32, 24)
        self.spinbox.valueChanged.connect(self.valChanged)
        layout.addWidget(self.spinbox)

        self.updating = False

        self.setFixedWidth(32) 
Example #6
Source Project: Miyamoto   Author: aboood40091   File: dialogs.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, type=Type_TextBox):
        super().__init__()

        self.label = QtWidgets.QLabel('-')
        self.label.setWordWrap(True)

        if type == InputBox.Type_TextBox:
            self.textbox = QtWidgets.QLineEdit()
            widget = self.textbox
        elif type == InputBox.Type_SpinBox:
            self.spinbox = QtWidgets.QSpinBox()
            widget = self.spinbox
        elif type == InputBox.Type_HexSpinBox:
            self.spinbox = HexSpinBox()
            widget = self.spinbox

        self.buttons = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)

        self.layout = QtWidgets.QVBoxLayout()
        self.layout.addWidget(self.label)
        self.layout.addWidget(widget)
        self.layout.addWidget(self.buttons)
        self.setLayout(self.layout) 
Example #7
Source Project: vidpipe   Author: jchrisweaver   File: main.py    License: GNU General Public License v3.0 6 votes vote down vote up
def saveFilterValue( self, obj ):
        assert( isinstance( obj.caller, QSpinBox ) or isinstance( obj.caller, QCheckBox ) or isinstance( obj.caller, QLineEdit ) )

        if isinstance( obj.caller, QSpinBox ):
            newVal = obj.caller.value()
        elif isinstance( obj.caller, QCheckBox ):
            newVal = obj.caller.isChecked()
        elif isinstance( obj.caller, QLineEdit ):
            if self.check_state( obj.caller ) != True:
                return
            newVal = [ int( t ) for t in obj.caller.text().split( "," ) ]

        try:
            func = getattr( obj.called, obj.action )
        except AttributeError:
            print( "Whoops, for some reason the callback isn't valid." )
        else:
            result = func( newVal )

        # reset the frame rate
        self._frameRate_RunningAvg = -1 
Example #8
Source Project: CvStudio   Author: haruiz   File: model_wizard.py    License: MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(BaseModelSelectionPage, self).__init__(parent)
        self.setTitle("Base Model Selection")
        self._layout = QVBoxLayout(self)
        _model_section_widget = QWidget()
        _section_layout = QFormLayout(_model_section_widget)
        self.ds_picker = DatasetPicker()
        self.arch_picker = ModelPicker()
        self._num_of_epochs_picker = QSpinBox()
        self._num_of_workers_picker = QSpinBox()
        self._batch_size_picker = QSpinBox()
        self._learning_rate_picker = QDoubleSpinBox()
        self._learning_momentum_picker = QDoubleSpinBox()
        self._learning_weight_decay_picker = QDoubleSpinBox()
        self._learning_weight_decay_picker = QDoubleSpinBox()
        _section_layout.addRow(self.tr("Dataset: "), self.ds_picker)
        _section_layout.addRow(self.tr("Architecture: "), self.arch_picker)
        _section_layout.addRow(self.tr("Number of epochs: "), self._num_of_epochs_picker)
        _section_layout.addRow(self.tr("Number of workers: "), self._num_of_workers_picker)
        _section_layout.addRow(self.tr("Batch Size: "), self._batch_size_picker)
        _section_layout.addRow(self.tr("Learning rate: "), self._learning_rate_picker)
        self._layout.addWidget(GUIUtilities.wrap_with_groupbox(_model_section_widget, "Model Details")) 
Example #9
Source Project: picasso   Author: jungmannlab   File: average.py    License: MIT License 6 votes vote down vote up
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle("Parameters")
        self.setModal(False)
        grid = QtWidgets.QGridLayout(self)

        grid.addWidget(QtWidgets.QLabel("Oversampling:"), 0, 0)
        self.oversampling = QtWidgets.QDoubleSpinBox()
        self.oversampling.setRange(1, 1e7)
        self.oversampling.setValue(10)
        self.oversampling.setDecimals(1)
        self.oversampling.setKeyboardTracking(False)
        self.oversampling.valueChanged.connect(self.window.view.update_image)
        grid.addWidget(self.oversampling, 0, 1)

        grid.addWidget(QtWidgets.QLabel("Iterations:"), 1, 0)
        self.iterations = QtWidgets.QSpinBox()
        self.iterations.setRange(0, 1e7)
        self.iterations.setValue(10)
        grid.addWidget(self.iterations, 1, 1) 
Example #10
Source Project: picasso   Author: jungmannlab   File: average3.py    License: MIT License 6 votes vote down vote up
def __init__(self, window):
        super().__init__(window)
        self.window = window
        self.setWindowTitle("Parameters")
        self.setModal(False)
        grid = QtWidgets.QGridLayout(self)

        grid.addWidget(QtWidgets.QLabel("Oversampling:"), 0, 0)
        self.oversampling = QtWidgets.QDoubleSpinBox()
        self.oversampling.setRange(1, 200)
        self.oversampling.setValue(DEFAULT_OVERSAMPLING)
        self.oversampling.setDecimals(1)
        self.oversampling.setKeyboardTracking(False)
        self.oversampling.valueChanged.connect(self.window.updateLayout)
        grid.addWidget(self.oversampling, 0, 1)

        self.iterations = QtWidgets.QSpinBox()
        self.iterations.setRange(1, 1)
        self.iterations.setValue(1) 
Example #11
Source Project: PyRAT   Author: birgander2   File: Widgets.py    License: Mozilla Public License 2.0 6 votes vote down vote up
def __init__(self, title=None, parent=None):
        super(CropBoxWidget, self).__init__(parent)
        self.value = [0]*4
        layout = QtWidgets.QGridLayout(self)
        if isinstance(title, str):
            layout.addWidget(QtWidgets.QLabel(title), 0, 0)
        self.crop1 = QtWidgets.QSpinBox()
        self.crop2 = QtWidgets.QSpinBox()
        self.crop3 = QtWidgets.QSpinBox()
        self.crop4 = QtWidgets.QSpinBox()
        cropbox = QtWidgets.QGridLayout()
        cropbox.addWidget(QtWidgets.QLabel("range start"), 0, 0)
        cropbox.addWidget(self.crop1, 1, 0)
        cropbox.addWidget(QtWidgets.QLabel("range end"), 2, 0)
        cropbox.addWidget(self.crop2, 3, 0)
        cropbox.addWidget(QtWidgets.QLabel("azimuth start"), 0, 1)
        cropbox.addWidget(self.crop3, 1, 1)
        cropbox.addWidget(QtWidgets.QLabel("azimuth end"), 2, 1)
        cropbox.addWidget(self.crop4, 3, 1)
        layout.addLayout(cropbox, 1, 0)
        self.minmaxMemory = []
        self.setrange([[0, 9999999], [0, 9999999], [0, 9999999], [0, 9999999]])
        self.setContentsMargins(0, 0, 0, 0)
        self.layout().setContentsMargins(0, 0, 0, 0) 
Example #12
Source Project: code-jam-5   Author: python-discord   File: gui.py    License: MIT License 6 votes vote down vote up
def __init__(self, settings, parent=None):
        super(SettingsPop, self).__init__(parent)
        self.main_layout = QtWidgets.QVBoxLayout()

        self.fps_layout = QtWidgets.QHBoxLayout()
        self.fps_label = QtWidgets.QLabel()
        self.fps_spin = QtWidgets.QSpinBox()

        self.step_layout = QtWidgets.QHBoxLayout()
        self.step_label = QtWidgets.QLabel()
        self.step_combo = QtWidgets.QComboBox()

        self.color_map_layout = QtWidgets.QHBoxLayout()
        self.color_map = QtWidgets.QPushButton()
        self.color_map_label = QtWidgets.QLabel()

        self.settings = settings

        self.save_button = QtWidgets.QPushButton()
        self.license_button = QtWidgets.QPushButton() 
Example #13
Source Project: asammdf   Author: danielhrisca   File: define_channel.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def op1_constant_changed(self, index):
        if self.op1_type.currentText() == "int":
            if self.op1_value is not None:
                self.op1_value.setParent(None)
                self.op1_value = None
            self.op1_value = QtWidgets.QSpinBox()
            self.op1_value.setRange(-2147483648, 2147483647)
            self.gridLayout.addWidget(self.op1_value, 0, 3)
        else:
            if self.op1_value is not None:
                self.op1_value.setParent(None)
                self.op1_value = None
            self.op1_value = QtWidgets.QDoubleSpinBox()
            self.op1_value.setDecimals(6)
            self.op1_value.setRange(-(2 ** 64), 2 ** 64 - 1)
            self.gridLayout.addWidget(self.op1_value, 0, 3) 
Example #14
Source Project: asammdf   Author: danielhrisca   File: define_channel.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def op2_constant_changed(self, index):
        if self.op2_type.currentText() == "int":
            if self.op2_value is not None:
                self.op2_value.setParent(None)
                self.op2_value = None
            self.op2_value = QtWidgets.QSpinBox()
            self.op2_value.setRange(-2147483648, 2147483647)
            self.gridLayout.addWidget(self.op2_value, 2, 3)
        else:
            if self.op2_value is not None:
                self.op2_value.setParent(None)
                self.op2_value = None
            self.op2_value = QtWidgets.QDoubleSpinBox()
            self.op2_value.setDecimals(6)
            self.op2_value.setRange(-(2 ** 64), 2 ** 64 - 1)
            self.gridLayout.addWidget(self.op2_value, 2, 3) 
Example #15
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()

        self.updating_gui_bool = False

        self.overview_qlw = TimingOverviewWt()
        self.grid = QtWidgets.QGridLayout()
        self.notification_interval_qsp = QtWidgets.QSpinBox()
        self.show_after_qsb = QtWidgets.QSpinBox()
        self.rest_interval_qsp = QtWidgets.QSpinBox()

        self._init_ui()
        self.update_gui()
        self._connect_slots_to_signals() 
Example #16
Source Project: ddt4all   Author: cedricp   File: dataeditor.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, dataitem, parent=None):
        super(numericListPanel, self).__init__(parent)
        self.setFrameStyle(widgets.QFrame.Sunken)
        self.setFrameShape(widgets.QFrame.Box)
        self.data = dataitem

        layoutv = widgets.QVBoxLayout()
        layout = widgets.QGridLayout()
        labelnob = widgets.QLabel(_("Number of bits"))
        lablelsigned = widgets.QLabel(_("Signed"))
        newitem = widgets.QPushButton(_("Add item"))
        delitem = widgets.QPushButton(_("Del item"))

        newitem.clicked.connect(self.add_item)
        delitem.clicked.connect(self.def_item)

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lablelsigned, 1, 0)
        layout.addWidget(newitem, 2, 0)
        layout.addWidget(delitem, 2, 1)

        self.inputnob = widgets.QSpinBox()
        self.inputnob.setRange(1, 32)
        self.inputsigned = widgets.QCheckBox()

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputsigned, 1, 1)

        layoutv.addLayout(layout)

        self.itemtable = widgets.QTableWidget()
        self.itemtable.setRowCount(1)
        self.itemtable.setColumnCount(2)
        self.itemtable.verticalHeader().hide()
        self.itemtable.setSelectionBehavior(widgets.QAbstractItemView.SelectRows)
        self.itemtable.setSelectionMode(widgets.QAbstractItemView.SingleSelection)

        layoutv.addWidget(self.itemtable)

        self.setLayout(layoutv)
        self.init() 
Example #17
Source Project: ddt4all   Author: cedricp   File: dataeditor.py    License: GNU General Public License v3.0 5 votes vote down vote up
def add_item(self):
        value = -999
        self.itemtable.setRowCount(self.itemtable.rowCount() + 1)
        newrow = self.itemtable.rowCount() - 1
        spinvalue = widgets.QSpinBox()
        spinvalue.setRange(-1000000, 1000000)
        spinvalue.setValue(value)
        self.itemtable.setCellWidget(newrow, 0, spinvalue)
        self.itemtable.setItem(newrow, 1, widgets.QTableWidgetItem(_("New item")))
        self.itemtable.setItem(newrow, 0, widgets.QTableWidgetItem(str(value).zfill(5)))
        self.itemtable.resizeRowsToContents()
        self.itemtable.resizeColumnsToContents() 
Example #18
Source Project: ddt4all   Author: cedricp   File: dataeditor.py    License: GNU General Public License v3.0 5 votes vote down vote up
def init(self):
        if not self.data:
            return

        self.itemtable.clear()

        keys = self.data.items.keys()
        self.itemtable.setRowCount(len(keys))

        self.inputsigned.setChecked(self.data.signed)
        self.inputnob.setValue(self.data.bitscount)

        count = 0
        for k, v in self.data.items.iteritems():
            spinvalue = widgets.QSpinBox()
            spinvalue.setRange(-1000000,1000000)
            spinvalue.setValue(int(v))
            self.itemtable.setCellWidget(count, 0, spinvalue)
            self.itemtable.setItem(count, 0, widgets.QTableWidgetItem(str(v).zfill(5)))
            self.itemtable.setItem(count, 1, widgets.QTableWidgetItem(k))
            count += 1

        headerstrings = str(_("Value;Text")).split(";")
        self.itemtable.setHorizontalHeaderLabels(headerstrings)
        self.itemtable.resizeColumnsToContents()
        self.itemtable.resizeRowsToContents()
        self.itemtable.sortItems(0, core.Qt.AscendingOrder)
        #self.itemtable.setSortingEnabled(True) 
Example #19
Source Project: ddt4all   Author: cedricp   File: dataeditor.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, iscan=True):
        widgets.QSpinBox.__init__(self)
        self.set_can(iscan) 
Example #20
Source Project: 3d-nii-visualizer   Author: adamkwolf   File: MainWindow.py    License: MIT License 5 votes vote down vote up
def create_new_picker(max_value, min_value, step, picker_value, value_changed_func):
        if isinstance(max_value, int):
            picker = QtWidgets.QSpinBox()
        else:
            picker = QtWidgets.QDoubleSpinBox()

        picker.setMaximum(max_value)
        picker.setMinimum(min_value)
        picker.setSingleStep(step)
        picker.setValue(picker_value)
        picker.valueChanged.connect(value_changed_func)
        return picker 
Example #21
Source Project: MDT   Author: robbert-harms   File: ui_scientific_number_scroller_widget.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, ScientificScroller):
        ScientificScroller.setObjectName("ScientificScroller")
        ScientificScroller.resize(283, 61)
        self.horizontalLayout = QtWidgets.QHBoxLayout(ScientificScroller)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.mantissa = QDoubleSpinBoxDotSeparator(ScientificScroller)
        self.mantissa.setSpecialValueText("")
        self.mantissa.setDecimals(4)
        self.mantissa.setMinimum(-1000.0)
        self.mantissa.setMaximum(1000.0)
        self.mantissa.setSingleStep(0.01)
        self.mantissa.setObjectName("mantissa")
        self.horizontalLayout.addWidget(self.mantissa)
        self.label = QtWidgets.QLabel(ScientificScroller)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.exponent = QtWidgets.QSpinBox(ScientificScroller)
        self.exponent.setMinimum(-99)
        self.exponent.setObjectName("exponent")
        self.horizontalLayout.addWidget(self.exponent)
        self.horizontalLayout.setStretch(0, 1)

        self.retranslateUi(ScientificScroller)
        QtCore.QMetaObject.connectSlotsByName(ScientificScroller) 
Example #22
Source Project: awesometts-anki-addon   Author: AwesomeTTS   File: configurator.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _ui_tabs_mp3gen_throttle(self):
        """Returns the "Download Throttling" input group."""

        threshold = QtWidgets.QSpinBox()
        threshold.setObjectName('throttle_threshold')
        threshold.setRange(5, 1000)
        threshold.setSingleStep(5)
        threshold.setSuffix(" operations")

        sleep = QtWidgets.QSpinBox()
        sleep.setObjectName('throttle_sleep')
        sleep.setRange(15, 10800)
        sleep.setSingleStep(15)
        sleep.setSuffix(" seconds")

        hor = QtWidgets.QHBoxLayout()
        hor.addWidget(Label("After "))
        hor.addWidget(threshold)
        hor.addWidget(Label(" sleep for "))
        hor.addWidget(sleep)
        hor.addStretch()

        rtr = self._addon.router
        vert = QtWidgets.QVBoxLayout()
        vert.addWidget(Note("Tweak how often AwesomeTTS takes a break when "
                            "mass downloading files from online services."))
        vert.addLayout(hor)
        vert.addWidget(Note("Affects %s." %
                            ', '.join(rtr.by_trait(rtr.Trait.INTERNET))))

        group = QtWidgets.QGroupBox("Download Throttling during Batch Processing")
        group.setLayout(vert)
        return group 
Example #23
Source Project: awesometts-anki-addon   Author: AwesomeTTS   File: configurator.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _ui_tabs_advanced_cache(self):
        """Returns the "Caching" input group."""

        days = QtWidgets.QSpinBox()
        days.setObjectName('cache_days')
        days.setRange(0, 9999)
        days.setSuffix(" days")

        hor = QtWidgets.QHBoxLayout()
        hor.addWidget(Label("Delete files older than"))
        hor.addWidget(days)
        hor.addWidget(Label("at exit (zero clears everything)"))
        hor.addStretch()

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(Note("AwesomeTTS caches generated audio files and "
                              "remembers failures during each session to "
                              "speed up repeated playback."))
        layout.addLayout(hor)

        abutton = QtWidgets.QPushButton("Delete Files")
        abutton.setObjectName('on_cache')
        abutton.clicked.connect(lambda: self._on_cache_clear(abutton))

        fbutton = QtWidgets.QPushButton("Forget Failures")
        fbutton.setObjectName('on_forget')
        fbutton.clicked.connect(lambda: self._on_forget_failures(fbutton))

        hor = QtWidgets.QHBoxLayout()
        hor.addWidget(abutton)
        hor.addWidget(fbutton)
        layout.addLayout(hor)

        group = QtWidgets.QGroupBox("Caching")
        group.setLayout(layout)
        return group

    # Factories ############################################################## 
Example #24
Source Project: pychemqt   Author: jjgomera   File: prefElemental.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, config=None, parent=None):
        super(Widget, self).__init__(parent)
        layout = QtWidgets.QGridLayout(self)

        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Color by element:")),
            1, 1)
        colorby = ["Element", "serie", "group_element", "period", "block", "phase",
                   "lattice_type", "space_group", "density_Solid",
                   "density_Liq", "density_Gas", "date", "atomic_mass",
                   "atomic_volume", "atomic_radius", "covalent_radius",
                   "vanderWaals_radius", "electronegativity",
                   "electron_affinity", "first_ionization", "Tf", "Tb",
                   "Heat_f", "Heat_b", "Cp", "k", "T_debye"]
        self.ElementalColorby = QtWidgets.QComboBox()
        for c in colorby:
            self.ElementalColorby.addItem(c)
        layout.addWidget(self.ElementalColorby, 1, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Color definition")),
            2, 1)
        self.ElementalDefinition = QtWidgets.QSpinBox()
        self.ElementalDefinition.setMaximumWidth(50)
        self.ElementalDefinition.setMinimum(5)
        layout.addWidget(self.ElementalDefinition, 2, 2)
        self.ElementalLog = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale"))
        layout.addWidget(self.ElementalLog, 3, 1, 1, 2)
        layout.addItem(QtWidgets.QSpacerItem(
            0, 0, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 4, 3)

        if config.has_section("Applications"):
            self.ElementalColorby.setCurrentText(
                config.get("Applications", 'elementalColorby'))
            self.ElementalDefinition.setValue(
                config.getint("Applications", 'elementalDefinition'))
            self.ElementalLog.setChecked(
                config.getboolean("Applications", 'elementalLog')) 
Example #25
Source Project: pychemqt   Author: jjgomera   File: delegate.py    License: GNU General Public License v3.0 5 votes vote down vote up
def createEditor(self, parent, option, index):
        widget = QtWidgets.QSpinBox(parent)
        widget.setAlignment(QtCore.Qt.AlignRight)
        widget.setMinimum(1)
        return widget 
Example #26
Source Project: pychemqt   Author: jjgomera   File: inputTable.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, value, parent=None):
        super(eqDIPPR, self).__init__(parent)
        layout = QtWidgets.QHBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Eq DIPPR") + " "))
        self.eqDIPPR = QtWidgets.QSpinBox()
        self.eqDIPPR.setValue(value)
        self.eqDIPPR.setRange(1, 9)
        self.eqDIPPR.setAlignment(
            QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        self.eqDIPPR.setFixedWidth(50)
        txt = QtWidgets.QApplication.translate("pychemqt", "Equation") + "\n"
        txt += "\t1:\tY = A+B*T+C*T²+D*T³+E*T⁴\n"
        txt += "\t2:\tY = exp(A+B*T+C*ln(T)+D*T^E)\n"
        txt += "\t3:\tY = A*T^(B/(1+C*T+D*T^2))\n"
        txt += "\t4:\tY = A+B*exp(-C/T^D)\n"
        txt += "\t5:\tY = A + B/T + C/T³ + D/T⁸ + E/T⁹\n"
        txt += "\t6:\tY = A/(B^(1+(1-T/C)^D)\n"
        txt += "\t7:\tY = A*(1-Tr)^(B+C*Tr+D*Tr²+E*Tr³)\n"
        txt += "\t8:\tY = A+ B*((C/T)/sinh(C/T))² + D*((E/T)/cosh(E/T))²\n"
        txt += "\t9:\tY = A²/Tr+B-2ACTr-ADTr²-C²Tr³/3-CDTr⁴/2-D²Tr⁵/5\n"
        txt += QtWidgets.QApplication.translate("pychemqt", "where") + ":\n"
        txt += "\t" + QtWidgets.QApplication.translate(
            "pychemqt", "Y Property to fit") + "\n"
        txt += "\t" + QtWidgets.QApplication.translate(
            "pychemqt", "T temperature in Kelvin") + "\n"
        txt += "\t" + QtWidgets.QApplication.translate(
            "pychemqt", "Tr: reduced temperature T/Tc") + "\n"
        txt += "\t" + QtWidgets.QApplication.translate(
            "pychemqt", "A,B,C,D,E parameters")
        self.eqDIPPR.setToolTip(txt)
        layout.addWidget(self.eqDIPPR)
        layout.addStretch() 
Example #27
Source Project: Miyamoto   Author: aboood40091   File: misc.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setMinimum(self, value):
        self.validator.min = value
        QtWidgets.QSpinBox.setMinimum(self, value) 
Example #28
Source Project: Miyamoto   Author: aboood40091   File: misc.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setMaximum(self, value):
        self.validator.max = value
        QtWidgets.QSpinBox.setMaximum(self, value) 
Example #29
Source Project: Miyamoto   Author: aboood40091   File: misc.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setRange(self, min, max):
        self.validator.min = min
        self.validator.max = max
        QtWidgets.QSpinBox.setMinimum(self, min)
        QtWidgets.QSpinBox.setMaximum(self, max) 
Example #30
Source Project: Miyamoto   Author: aboood40091   File: dialogs.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        """
        Creates and initializes the dialog
        """
        super().__init__()
        self.setWindowTitle(globals.trans.string('ShftItmDlg', 0))
        self.setWindowIcon(GetIcon('move'))

        self.XOffset = QtWidgets.QSpinBox()
        self.XOffset.setRange(-16384, 16383)

        self.YOffset = QtWidgets.QSpinBox()
        self.YOffset.setRange(-8192, 8191)

        buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)

        moveLayout = QtWidgets.QFormLayout()
        offsetlabel = QtWidgets.QLabel(globals.trans.string('ShftItmDlg', 2))
        offsetlabel.setWordWrap(True)
        moveLayout.addWidget(offsetlabel)
        moveLayout.addRow(globals.trans.string('ShftItmDlg', 3), self.XOffset)
        moveLayout.addRow(globals.trans.string('ShftItmDlg', 4), self.YOffset)

        moveGroupBox = QtWidgets.QGroupBox(globals.trans.string('ShftItmDlg', 1))
        moveGroupBox.setLayout(moveLayout)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addWidget(moveGroupBox)
        mainLayout.addWidget(buttonBox)
        self.setLayout(mainLayout)