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


Python QtGui.QDoubleSpinBox方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def __init__(self, name, config, parent=None):
        
        ActionOptionNumeric.__init__(self, name, config)
        QtGui.QDoubleSpinBox.__init__(self, parent=parent)

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

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

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

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:17,代码来源:options.py

示例2: value

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def value(self):
        return QtGui.QDoubleSpinBox.value(self)

# ----------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:6,代码来源:options.py

示例3: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def __init__(self,fig):
        self.fig = fig
        toolbar = fig.canvas.toolbar
        
        self.line_edit = QtGui.QLineEdit()
        toolbar.addWidget(self.line_edit)
        self.line_edit.editingFinished.connect(self.do_something)

        self.spinbox = QtGui.QDoubleSpinBox()
        toolbar.addWidget(self.spinbox)
        self.spinbox.valueChanged.connect(self.do_something2) 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:13,代码来源:matplotlib_figure_mod_toolbar.py

示例4: set_spinbox

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def set_spinbox(self, parent):
        self.spinb = QtGui.QDoubleSpinBox(parent=parent)
        self.spinb.setDecimals(3)
        self.spinb.setRange(0.001, 3600.)
        self.spinb.setSuffix(" s")
        self.spinb.setValue(self.width)   # set the initial width
        self.spinb.valueChanged.connect(self.xwidth_changed)
        parent.addWidget(self.spinb) 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:10,代码来源:timetrace_scroll_demo.py

示例5: set_spinbox

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def set_spinbox(self, parent):
        self.spinb = QtGui.QDoubleSpinBox(parent=parent)
        self.spinb.setDecimals(3)
        self.spinb.setRange(0.001, 3600.)
        self.spinb.setSuffix(" s")
        self.spinb.setValue(self.step)   # set the initial width
        self.spinb.valueChanged.connect(self.xwidth_changed)
        parent.addWidget(self.spinb) 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:10,代码来源:timetrace_scroll_pygraphqt.py

示例6: set_spinbox

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def set_spinbox(self, parent):
        self.spinb = QtGui.QDoubleSpinBox(parent=parent)
        self.spinb.setDecimals(3)
        self.spinb.setRange(0.001, 3600.)
        self.spinb.setSuffix(" s")
        self.spinb.setValue(self.plot_width)   # set the initial width
        self.spinb.valueChanged.connect(self.xwidth_changed)
        parent.addWidget(self.spinb) 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:10,代码来源:timetrace_scroll_demo3.py

示例7: set_spinbox

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def set_spinbox(self, parent):
        if self.debug:
            pprint('ScrollingToolQT set_spinbox\n')
        self.spinb = QtGui.QDoubleSpinBox(parent=parent)
        self.spinb.setDecimals(3)
        self.spinb.setRange(0.001, 60e3)
        self.spinb.setSuffix(" ms")
        self.spinb.setValue(self.width * 1e3)   # set the initial width
        self.spinb.valueChanged.connect(self.spinbox_changed)
        parent.addWidget(self.spinb) 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:12,代码来源:scroll_gui.py

示例8: generateWidget

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def generateWidget( self, parameterDict, constraint_to_animate ):
        self.parameterDict = parameterDict
        self.constraint_to_animate = constraint_to_animate
        spinbox = QtGui.QDoubleSpinBox()
        default = self.getDefaultValue()
        spinbox.setMinimum( self.spinBox_min )
        spinbox.setMaximum( self.spinBox_max )
        spinbox.setSingleStep( self.spinBox_increment )
        spinbox.setDecimals( self.spinBox_decimalPlaces )
        spinbox.setValue( default )
        #spinbox.valueChanged.connect( self.valueChanged )
        #self.valueChanged(default)
        self.spinbox = spinbox
        return  Qt_label_widget( self.label, spinbox, self.info_button_text ) 
开发者ID:hamish2014,项目名称:FreeCAD_assembly2,代码行数:16,代码来源:animate_constraint.py

示例9: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def __init__(self, tabWidget):
        AbstractTab.__init__(self, tabWidget, Strings.searcherTabLoggerName,
                             [2, 3, 4], Strings.searcherTabPacketTableViewName,
                             Strings.searcherTabLabelInterfaceValueName)

        #: The currently smallest known set of packets that cause a specific action.
        #: Values are lists with raw data
        self.lastWorkingChunk = []

        # Packet gap
        self.sleepTime = 0

        #: We first search downwards in the binary search tree. If this doesn't
        #: succeed, we use randomization and begint to search upwards.
        self.downwardsSearch = True

        # Get all GUI elements
        self.buttonSearcherAddPacket = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonSearcherAddPacket")
        self.doubleSpinBoxSearcherPacketGap = self.tabWidget.findChild(
            QtGui.QDoubleSpinBox, "doubleSpinBoxSearcherPacketGap")
        self.buttonSearcherInterfaceSettings = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonSearcherInterfaceSettings")
        self.buttonSearcherStart = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonSearcherStart")
        self.buttonSearcherDataClear = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonSearcherDataClear")

        assert all(GUIElem is not None for GUIElem in [
            self.buttonSearcherAddPacket, self.doubleSpinBoxSearcherPacketGap,
            self.buttonSearcherInterfaceSettings, self.buttonSearcherStart,
            self.buttonSearcherDataClear
        ]), "GUI Elements not found"

        self.buttonSearcherInterfaceSettings.clicked.connect(
            self.handleInterfaceSettingsDialog)
        self.buttonSearcherStart.clicked.connect(self.searchPackets)
        self.buttonSearcherAddPacket.clicked.connect(self.manualAddPacket)
        self.buttonSearcherDataClear.clicked.connect(self.clear)

        self.prepareUI() 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:43,代码来源:SearcherTab.py

示例10: generateWidget

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def generateWidget( self, dimensioningProcess ):
        self.dimensioningProcess = dimensioningProcess
        spinbox = QtGui.QDoubleSpinBox()
        spinbox.setValue( self.getDefaultValue() )
        spinbox.setMinimum( self.spinBox_min )
        spinbox.setSingleStep( self.spinBox_increment )
        spinbox.setDecimals(self.spinBox_decimals)
        spinbox.valueChanged.connect( self.valueChanged )
        self.spinbox = spinbox
        return  DimensioningTaskDialog_generate_row_hbox( self.label, spinbox ) 
开发者ID:hamish2014,项目名称:FreeCAD_drawing_dimensioning,代码行数:12,代码来源:preferences.py

示例11: create_item

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def create_item(self, widget_config, grid, row_index):
        widget_config.widget_title = QtGui.QLabel(self.form)
        widget_config.widget_title.setText("%s : " % widget_config.show_name)

        if widget_config.type == float and not hasattr(widget_config, 'step'):
            widget_config.widget = QtGui.QLabel(self.form)
            widget_config.widget.setText("%f" % self.get_property_value(widget_config.name))
        elif widget_config.type == float:
            widget_config.widget = QtGui.QDoubleSpinBox(self.form)
            widget_config.widget.setDecimals(widget_config.decimals)
            widget_config.widget.setSingleStep(widget_config.step)
            widget_config.widget.setMinimum(widget_config.interval_value[0])
            widget_config.widget.setMaximum(widget_config.interval_value[-1])
            widget_config.widget.setValue(self.get_property_value(widget_config.name))
        elif widget_config.type == bool:
            widget_config.widget = QtGui.QCheckBox("", self.form)
            state = QtCore.Qt.Checked if self.get_property_value(widget_config.name) == True else QtCore.Qt.Unchecked
            widget_config.widget.setCheckState(state)
        elif widget_config.type == list:
            widget_config.widget = QtGui.QComboBox(self.form)
            widget_config.widget.addItems(widget_config.interval_value)
            default_value_index = 0
            for str_value in widget_config.interval_value:
                if self.get_property_value(widget_config.name) == str_value:
                    break
                default_value_index += 1
            if default_value_index == len(widget_config.interval_value):
                raise ValueError("Default value not found for list" + widget_config.name)
            widget_config.widget.setCurrentIndex(default_value_index)
            widget_config.widget.currentIndexChanged.connect(self.listchangeIndex)
        elif widget_config.type == str:
            widget_config.widget = QtGui.QLineEdit(self.form)
            widget_config.widget.setText(self.get_property_value(widget_config.name))
        else:
            raise ValueError("Undefined widget type")

        grid.addWidget(widget_config.widget_title, row_index, 0)
        grid.addWidget(widget_config.widget, row_index, 1) 
开发者ID:execuc,项目名称:LCInterlocking,代码行数:40,代码来源:toolwidget.py

示例12: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
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() 
开发者ID:tritemio,项目名称:FRETBursts,代码行数:52,代码来源:scroll_gui.py

示例13: drawUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def drawUI(self):
        # Our main window will be a QDialog
        # make this dialog stay above the others, always visible
        self.UI.setWindowFlags( QtCore.Qt.WindowStaysOnTopHint )
        self.UI.setWindowTitle('Add Variable')
        self.UI.setWindowIcon( QtGui.QIcon( os.path.join( Asm4.iconPath , 'FreeCad.svg' ) ) )
        self.UI.setMinimumWidth(470)
        self.UI.resize(470,300)
        self.UI.setModal(False)
        # the layout for the main window is vertical (top to down)
        self.mainLayout = QtGui.QVBoxLayout(self.UI)

        # Define the fields for the form ( label + widget )
        self.formLayout = QtGui.QFormLayout()
        # Variable Type, combobox showing all available App::PropertyType
        self.typeList = QtGui.QComboBox()
        self.formLayout.addRow(QtGui.QLabel('Type'),self.typeList)
        # Variable Name
        self.varName = QtGui.QLineEdit()
        self.formLayout.addRow(QtGui.QLabel('Name'),self.varName)
        # Variable Value
        self.varValue = QtGui.QDoubleSpinBox()
        self.varValue.setRange( -1000000.0, 1000000.0 )
        self.formLayout.addRow(QtGui.QLabel('Value'),self.varValue)
        # Documentation
        self.description = QtGui.QTextEdit()
        self.formLayout.addRow(QtGui.QLabel('Description'),self.description)
        # apply the layout
        self.mainLayout.addLayout(self.formLayout)
        self.mainLayout.addStretch()

        # Buttons
        self.buttonLayout = QtGui.QHBoxLayout()
        # Cancel button
        self.CancelButton = QtGui.QPushButton('Cancel')
        # OK button
        self.OkButton = QtGui.QPushButton('OK')
        self.OkButton.setDefault(True)
        # the button layout
        self.buttonLayout.addWidget(self.CancelButton)
        self.buttonLayout.addStretch()
        self.buttonLayout.addWidget(self.OkButton)
        self.mainLayout.addLayout(self.buttonLayout)

        # finally, apply the layout to the main window
        self.UI.setLayout(self.mainLayout)

        # Actions
        self.CancelButton.clicked.connect(self.onCancel)
        self.OkButton.clicked.connect(self.onOK) 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:52,代码来源:VariablesLib.py

示例14: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def __init__(self, tabWidget):
        AbstractTab.__init__(
            self,
            tabWidget,
            Strings.UDSTabLoggerName, [2, 3, 4],
            Strings.UDSTabPacketViewName,
            Strings.UDSTabLabelInterfaceValueName,
            allowTablePaste=False)

        self.active = False

        #: Sending takes place in a loop in a separate thread
        self.UDSSenderThread = None
        #: Adding items also takes place in a separate thread to avoid blocking the GUI thread
        self.itemAdderThread = None

        #: These values will be available in the fuzzing mode ComboBox
        self.UDSModeComboBoxValuePairs = [("Read Data By ID", 0),
                                          ("Routine Control", 1)]

        # Get all GUI elements
        self.comboBoxUDSMode = self.tabWidget.findChild(
            QtGui.QComboBox, "comboBoxUDSMode")
        self.lineEditUDSTabUDSID = self.tabWidget.findChild(
            QtGui.QLineEdit, "lineEditUDSTabUDSID")
        self.doubleSpinBoxUDSPacketGap = self.tabWidget.findChild(
            QtGui.QDoubleSpinBox, "doubleSpinBoxUDSPacketGap")
        self.buttonUDSInterfaceSettings = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonUDSInterfaceSettings")
        self.buttonUDSTabToggleFuzzing = self.tabWidget.findChild(
            QtGui.QPushButton, "buttonUDSTabToggleFuzzing")
        self.buttonUDSClear = self.tabWidget.findChild(QtGui.QPushButton,
                                                       "buttonUDSClear")
        self.labelUDSCountValue = self.tabWidget.findChild(
            QtGui.QLabel, "labelUDSCountValue")

        assert all(GUIElem is not None for GUIElem in [
            self.comboBoxUDSMode, self.doubleSpinBoxUDSPacketGap, self.
            buttonUDSInterfaceSettings, self.buttonUDSTabToggleFuzzing, self.
            buttonUDSClear, self.labelUDSCountValue
        ]), "GUI Elements not found"

        self.buttonUDSInterfaceSettings.clicked.connect(
            self.handleInterfaceSettingsDialog)
        self.buttonUDSClear.clicked.connect(self.clear)
        self.comboBoxUDSMode.currentIndexChanged.connect(self.UDSModeChanged)
        self.buttonUDSTabToggleFuzzing.clicked.connect(self.toggleUDSFuzzing)

        self.prepareUI() 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:51,代码来源:UDSTab.py

示例15: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDoubleSpinBox [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(209, 149)
        self.gridLayout_2 = QtGui.QGridLayout(Dialog)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.placeButton = QtGui.QPushButton(Dialog)
        self.placeButton.setObjectName("placeButton")
        self.gridLayout_2.addWidget(self.placeButton, 2, 0, 1, 1)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Dialog)
        self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.label_2 = QtGui.QLabel(Dialog)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setMinimumSize(QtCore.QSize(61, 0))
        self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.upperLineEdit = QtGui.QLineEdit(Dialog)
        self.upperLineEdit.setObjectName("upperLineEdit")
        self.gridLayout.addWidget(self.upperLineEdit, 0, 1, 1, 1)
        self.lowerLineEdit = QtGui.QLineEdit(Dialog)
        self.lowerLineEdit.setObjectName("lowerLineEdit")
        self.gridLayout.addWidget(self.lowerLineEdit, 1, 1, 1, 1)
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
        self.scaleDoubleSpinBox = QtGui.QDoubleSpinBox(Dialog)
        self.scaleDoubleSpinBox.setMinimum(0.05)
        self.scaleDoubleSpinBox.setSingleStep(0.05)
        self.scaleDoubleSpinBox.setProperty("value", 0.8)
        self.scaleDoubleSpinBox.setObjectName("scaleDoubleSpinBox")
        self.gridLayout.addWidget(self.scaleDoubleSpinBox, 2, 1, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.placeButton, QtCore.SIGNAL("released()"), Dialog.accept)
        QtCore.QObject.connect(self.upperLineEdit, QtCore.SIGNAL("returnPressed()"), Dialog.accept)
        QtCore.QObject.connect(self.lowerLineEdit, QtCore.SIGNAL("returnPressed()"), Dialog.accept)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:hamish2014,项目名称:FreeCAD_drawing_dimensioning,代码行数:50,代码来源:toleranceDialog.py


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