当前位置: 首页>>代码示例>>Python>>正文


Python QDoubleSpinBox.setMinimum方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QDoubleSpinBox.setMinimum方法的典型用法代码示例。如果您正苦于以下问题:Python QDoubleSpinBox.setMinimum方法的具体用法?Python QDoubleSpinBox.setMinimum怎么用?Python QDoubleSpinBox.setMinimum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QDoubleSpinBox的用法示例。


在下文中一共展示了QDoubleSpinBox.setMinimum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createEditor

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
 def createEditor( self, parent, option, index ):
     if index.column() == DESCRIPCION:
         combo = QComboBox( parent )
         combo.setEditable( True )
         value = index.data().toString()
         self.filtrados.append( value )
         self.proxymodel.setFilterRegExp( self.filter() )
         combo.setModel( self.proxymodel )
         combo.setModelColumn( 1 )
         combo.setCompleter( self.completer )
         return combo
     elif index.column() == BANCO:
         combo = QComboBox( parent )
         #combo.setEditable(True)
         combo.setModel( self.bancosmodel )
         combo.setModelColumn( 1 )
         #combo.setCompleter(self.completer)
         return combo
     elif index.column() == MONTO:
         doublespinbox = QDoubleSpinBox( parent )
         doublespinbox.setMinimum( -1000000 )
         doublespinbox.setMaximum( 1000000 )
         doublespinbox.setDecimals( 4 )
         doublespinbox.setAlignment( Qt.AlignHCenter )
         return doublespinbox
     elif index.column() == REFERENCIA:
         textbox = QStyledItemDelegate.createEditor( self, parent, option, index )
         textbox.setAlignment( Qt.AlignHCenter )
         return textbox
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:31,代码来源:recibodelegate.py

示例2: FloatParameterWidget

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
class FloatParameterWidget(NumericParameterWidget):
    """Widget class for Float parameter."""
    def __init__(self, parameter, parent=None):
        """Constructor

        .. versionadded:: 2.2

        :param parameter: A FloatParameter object.
        :type parameter: FloatParameter

        """
        super(FloatParameterWidget, self).__init__(parameter, parent)

        self._input = QDoubleSpinBox()
        self._input.setDecimals(self._parameter.precision)
        self._input.setMinimum(self._parameter.minimum_allowed_value)
        self._input.setMaximum(self._parameter.maximum_allowed_value)
        self._input.setValue(self._parameter.value)
        self._input.setSingleStep(
            10 ** -self._parameter.precision)
        # is it possible to use dynamic precision ?
        string_min_value = '%.*f' % (
            self._parameter.precision, self._parameter.minimum_allowed_value)
        string_max_value = '%.*f' % (
            self._parameter.precision, self._parameter.maximum_allowed_value)
        tool_tip = 'Choose a number between %s and %s' % (
            string_min_value, string_max_value)
        self._input.setToolTip(tool_tip)

        self._input.setSizePolicy(self._spin_box_size_policy)

        self.inner_input_layout.addWidget(self._input)
        self.inner_input_layout.addWidget(self._unit_widget)
开发者ID:ismailsunni,项目名称:parameters,代码行数:35,代码来源:float_parameter_widget.py

示例3: createEditor

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
    def createEditor(self, parent, option, index):
        """
        Creates the combobox inside a parent.
        :param parent: The container of the combobox
        :type parent: QWidget
        :param option: QStyleOptionViewItem class is used to describe the
        parameters used to draw an item in a view widget.
        :type option: Object
        :param index: The index where the combobox
         will be added.
        :type index: QModelIndex
        :return: The combobox
        :rtype: QComboBox
        """

        if index.column() == 0:
            str_combo = QComboBox(parent)
            str_combo.setObjectName(unicode(index.row()))
            return str_combo
        elif index.column() == 1:

            spinbox = QDoubleSpinBox(parent)
            spinbox.setObjectName(unicode(index.row()))
            spinbox.setMinimum(0.00)
            spinbox.setSuffix('%')
            spinbox.setMaximum(100.00)
            return spinbox
开发者ID:gltn,项目名称:stdm,代码行数:29,代码来源:str_helpers.py

示例4: __init__

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
    def __init__(self, parent, prefix = None, suffix = None, option = None, min_ = None, max_ = None,
                 step = None, tip = None, value = None, changed =None):
        super(MyDoubleSpinBox, self).__init__(parent)
    
        if prefix:
            plabel = QLabel(prefix)
        else:
            plabel = None
        if suffix:
            slabel = QLabel(suffix)
        else:
            slabel = None
        spinbox = QDoubleSpinBox(parent)
        if min_ is not None:
            spinbox.setMinimum(min_)
        if max_ is not None:
            spinbox.setMaximum(max_)
        if step is not None:
            spinbox.setSingleStep(step)
        if tip is not None:
            spinbox.setToolTip(tip)
        layout = QHBoxLayout()
        for subwidget in (plabel, spinbox, slabel):
            if subwidget is not None:
                layout.addWidget(subwidget)
        if value is not None:
            spinbox.setValue(value)
        
        if changed is not None:
            self.connect(spinbox, SIGNAL('valueChanged(double)'), changed)

        layout.addStretch(1)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        self.spin = spinbox
开发者ID:sarahdi,项目名称:openfisca,代码行数:37,代码来源:qthelpers.py

示例5: _getSpinbox

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
 def _getSpinbox(self, minvalue, maxvalue, step, nullable = True, value = 0):
     '''
     Get a combobox filled with the given values
     
     :param values: The values as key = value, value = description or text
     :type values: Dict
     
     :returns: A combobox
     :rtype: QWidget
     '''
     
     widget = QWidget()
     spinbox = QDoubleSpinBox()
     spinbox.setMinimum(minvalue)
     spinbox.setMaximum(maxvalue)
     spinbox.setSingleStep(step)
     spinbox.setDecimals(len(str(step).split('.')[1]) if len(str(step).split('.'))==2 else 0)
     if nullable:
         spinbox.setMinimum(minvalue - step)
         spinbox.setValue(spinbox.minimum())
         spinbox.setSpecialValueText(str(QSettings().value('qgis/nullValue', 'NULL' )))
     if value is not None:
         spinbox.setValue(value)
     layout = QHBoxLayout(widget)
     layout.addWidget(spinbox, 1);
     layout.setAlignment(Qt.AlignCenter);
     layout.setContentsMargins(5,0,5,0);
     widget.setLayout(layout);
             
     return widget
开发者ID:Geoportail-Luxembourg,项目名称:qgis-pag-plugin,代码行数:32,代码来源:importer.py

示例6: XicWidget

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
class XicWidget(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        v = QVBoxLayout()
        f = QFormLayout()

        self.mzTolSpinBox = QDoubleSpinBox(self)
        self.mzTolSpinBox.setMaximum(100)
        self.mzTolSpinBox.setMinimum(1)
        self.mzTolSpinBox.setValue(10)

        f.addRow("mz tolerance(ppm):", self.mzTolSpinBox)

        self.mzSpinBox = QDoubleSpinBox(self)
        self.mzSpinBox.setMaximum(2000.0)
        self.mzSpinBox.setMinimum(300.0)
        self.mzSpinBox.setValue(500.0)

        f.addRow("requested m/z:", self.mzSpinBox)

        v.addLayout(f)

        self.plotButton = QPushButton("Plot")

        v.addWidget(self.plotButton)
        self.setLayout(v)
开发者ID:jerkos,项目名称:pymzdb,代码行数:29,代码来源:aditi.py

示例7: create_doublespinbox

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
 def create_doublespinbox(self, prefix, suffix, option, 
                    min_=None, max_=None, step=None, tip=None):
     if prefix:
         plabel = QLabel(prefix)
     else:
         plabel = None
     if suffix:
         slabel = QLabel(suffix)
     else:
         slabel = None
     spinbox = QDoubleSpinBox()
     if min_ is not None:
         spinbox.setMinimum(min_)
     if max_ is not None:
         spinbox.setMaximum(max_)
     if step is not None:
         spinbox.setSingleStep(step)
     if tip is not None:
         spinbox.setToolTip(tip)
     self.spinboxes[spinbox] = option
     layout = QHBoxLayout()
     for subwidget in (plabel, spinbox, slabel):
         if subwidget is not None:
             layout.addWidget(subwidget)
     layout.addStretch(1)
     layout.setContentsMargins(0, 0, 0, 0)
     widget = QWidget(self)
     widget.setLayout(layout)
     widget.spin = spinbox
     return widget
开发者ID:sarahdi,项目名称:openfisca,代码行数:32,代码来源:Config.py

示例8: ConfigWidget

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
class ConfigWidget(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        self.label_ip = QLabel("IP")
        self.lineedit_ip = QLineEdit()
        layout.addRow(self.label_ip, self.lineedit_ip)

        self.label_port = QLabel("Port")
        self.spinbox_port = QSpinBox()
        self.spinbox_port.setMinimum(0)
        self.spinbox_port.setMaximum(65535)
        layout.addRow(self.label_port, self.spinbox_port)

        self.label_password = QLabel("Password")
        self.lineedit_password = QLineEdit()
        layout.addRow(self.label_password, self.lineedit_password)

        self.label_mount = QLabel("Mount")
        self.lineedit_mount = QLineEdit()
        layout.addRow(self.label_mount, self.lineedit_mount)

        #
        # Audio Quality
        #

        self.label_audio_quality = QLabel("Audio Quality")
        self.spinbox_audio_quality = QDoubleSpinBox()
        self.spinbox_audio_quality.setMinimum(0.0)
        self.spinbox_audio_quality.setMaximum(1.0)
        self.spinbox_audio_quality.setSingleStep(0.1)
        self.spinbox_audio_quality.setDecimals(1)
        self.spinbox_audio_quality.setValue(0.3)  # Default value 0.3

        #
        # Video Quality
        #

        self.label_video_quality = QLabel("Video Quality (kb/s)")
        self.spinbox_video_quality = QSpinBox()
        self.spinbox_video_quality.setMinimum(0)
        self.spinbox_video_quality.setMaximum(16777215)
        self.spinbox_video_quality.setValue(2400)  # Default value 2400

    def get_video_quality_layout(self):
        layout_video_quality = QHBoxLayout()
        layout_video_quality.addWidget(self.label_video_quality)
        layout_video_quality.addWidget(self.spinbox_video_quality)

        return layout_video_quality

    def get_audio_quality_layout(self):
        layout_audio_quality = QHBoxLayout()
        layout_audio_quality.addWidget(self.label_audio_quality)
        layout_audio_quality.addWidget(self.spinbox_audio_quality)

        return layout_audio_quality
开发者ID:joanma100,项目名称:freeseer,代码行数:62,代码来源:widget.py

示例9: createEditor

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
 def createEditor(self, type, parent):
     if type != QVariant.Double:
         raise ValueError("This factory only creates editor for doubles")
     w = QDoubleSpinBox(parent)
     w.setDecimals(5)
     w.setMinimum(0.0001)
     w.setMaximum(10000)
     return w
开发者ID:PierreBdR,项目名称:point_tracker,代码行数:10,代码来源:editresdlg.py

示例10: createDoubleSpinBox

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
 def createDoubleSpinBox(self, variable_name, variable_value, variable_type, analysis_module_variables_model):
     spinner = QDoubleSpinBox()
     spinner.setMinimumWidth(75)
     spinner.setMaximum(analysis_module_variables_model.getVariableMaximumValue(variable_name))
     spinner.setMinimum(analysis_module_variables_model.getVariableMinimumValue(variable_name))
     spinner.setSingleStep(analysis_module_variables_model.getVariableStepValue(variable_name))
     spinner.setValue(variable_value)
     spinner.valueChanged.connect(partial(self.valueChanged,variable_name, variable_type, spinner))
     return spinner;
开发者ID:YingfangZhou,项目名称:ert,代码行数:11,代码来源:analysis_module_variables_panel.py

示例11: createWidget

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
	def createWidget(self, qt_parent=None):
		"""
		Return an editor widget suitable for editing the data type.

		For example, for QDateTime return a QDateTimeEdit(parent)
		"""
		sb = QDoubleSpinBox(qt_parent)
		sb.setFrame(False)
		sb.setMinimum(-float_info.max)
		sb.setMaximum(float_info.max)
		return sb
开发者ID:khedron,项目名称:Plot,代码行数:13,代码来源:float.py

示例12: ConfigWidget

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
class ConfigWidget(QWidget):

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        #
        # Audio Quality
        #

        self.label_audio_quality = QLabel("Audio Quality")
        self.spinbox_audio_quality = QDoubleSpinBox()
        self.spinbox_audio_quality.setMinimum(0.0)
        self.spinbox_audio_quality.setMaximum(1.0)
        self.spinbox_audio_quality.setSingleStep(0.1)
        self.spinbox_audio_quality.setDecimals(1)
        self.spinbox_audio_quality.setValue(0.3)            # Default value 0.3

        #
        # Video Quality
        #

        self.label_video_quality = QLabel("Video Quality (kb/s)")
        self.spinbox_video_quality = QSpinBox()
        self.spinbox_video_quality.setMinimum(0)
        self.spinbox_video_quality.setMaximum(16777215)
        self.spinbox_video_quality.setValue(2400)           # Default value 2400

        #
        # Misc.
        #
        self.label_matterhorn = QLabel("Matterhorn Metadata")
        self.label_matterhorn.setToolTip("Generates Matterhorn Metadata in XML format")
        self.checkbox_matterhorn = QCheckBox()
        layout.addRow(self.label_matterhorn, self.checkbox_matterhorn)

    def get_video_quality_layout(self):
        layout_video_quality = QHBoxLayout()
        layout_video_quality.addWidget(self.label_video_quality)
        layout_video_quality.addWidget(self.spinbox_video_quality)

        return layout_video_quality

    def get_audio_quality_layout(self):
        layout_audio_quality = QHBoxLayout()
        layout_audio_quality.addWidget(self.label_audio_quality)
        layout_audio_quality.addWidget(self.spinbox_audio_quality)

        return layout_audio_quality
开发者ID:Blakstar26,项目名称:freeseer,代码行数:53,代码来源:widget.py

示例13: createEditor

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
    def createEditor( self, parent, _option, index ):
        if index.column() in ( CODCUENTA, NCUENTA ):
            value = index.model().index( index.row(), 0 ).data().toString()
            self.removeFromFilter( value )
            self.proxymodel.setFilterRegExp( self.filter() )
            sp = SearchPanel( self.proxymodel, parent, self.showTable )
            sp.setColumn( index.column() )
            return sp
        elif index.column() == MONTO:
            doublespinbox = QDoubleSpinBox( parent )
            doublespinbox.setMinimum( -1000000 )
            doublespinbox.setMaximum( 1000000 )
            doublespinbox.setDecimals( 4 )

            return doublespinbox
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:17,代码来源:searchpaneldelegate.py

示例14: DoubleSpinBox

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
class DoubleSpinBox(QWidget):
    def __init__(self, id, text, **kwargs):
        QWidget.__init__(self)
        self.id = id
        self.widget = QDoubleSpinBox(**kwargs)
        label = QLabel(text)
        hbox = HBoxLayout()
        hbox.addWidget(label)
        hbox.addWidget(self.widget)
        self.setLayout(hbox)
        self.widget.setMaximum(999999999)
        self.widget.setMinimum(-999999999)

    def parameterValues(self):
        return {self.id:self.widget.value()}
开发者ID:karstenv,项目名称:manageR,代码行数:17,代码来源:plugins_dialog.py

示例15: createEditor

# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setMinimum [as 别名]
    def createEditor( self, parent, option, index ):

        if index.column() in ( CODCUENTA, NCUENTA ):
            model = index.model()
            self.proxymodel.setSourceModel( self.accounts )
            current = model.data( model.index( index.row(), IDCUENTA ) )
            self.proxymodel.setFilterRegExp( self.filter( model, current ) )

            sp = super( AccountsSelectorDelegate, self ).createEditor( parent, option, index )
            sp.setColumnHidden( IDCUENTA )
            return sp

        elif index.column() == MONTO:
            doublespinbox = QDoubleSpinBox( parent )
            doublespinbox.setMinimum( -100000000000 )
            doublespinbox.setMaximum( 100000000000 )
            doublespinbox.setDecimals( 4 )

            return doublespinbox
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:21,代码来源:accountselector.py


注:本文中的PyQt4.QtGui.QDoubleSpinBox.setMinimum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。