本文整理汇总了Python中PyQt4.QtGui.QDoubleSpinBox方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QDoubleSpinBox方法的具体用法?Python QtGui.QDoubleSpinBox怎么用?Python QtGui.QDoubleSpinBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QDoubleSpinBox方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_spinbox
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def set_spinbox(self, parent):
self.xmin_sb = QtGui.QDoubleSpinBox()
self.xmax_sb = QtGui.QDoubleSpinBox()
self.ymin_sb = QtGui.QDoubleSpinBox()
self.ymax_sb = QtGui.QDoubleSpinBox()
sb_list = [self.xmin_sb,self.xmax_sb,self.ymin_sb,self.ymax_sb]
values = [self.xmin, self.xmax, self.ymin, self.ymax]
for spinbox, val in zip(sb_list, values):
spinbox.setDecimals(4)
spinbox.setRange(-1e9,1e9)
spinbox.setValue(val) # set the initial width
spinbox.valueChanged.connect(self.range_changed)
parent.addWidget(spinbox)
spinbox.setMinimumWidth(100)
#spinbox.setMaximumWidth(100)
示例2: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def __init__(self):
super(Display, self).__init__()
layout = QtGui.QHBoxLayout()
layout.addWidget(QtGui.QLabel('Value:'))
input = QtGui.QDoubleSpinBox()
layout.addWidget(input)
self.setLayout(layout)
self.connect(input, QtCore.SIGNAL('valueChanged(double)'), self.newValue)
self.drv = myDriver()
示例3: _set_up_opt_spin_box
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def _set_up_opt_spin_box(self):
check_box = QCheckBox()
spin_box = QDoubleSpinBox()
spin_box.setDecimals(5)
spin_box.setSingleStep(0.01)
spin_box.setMinimum(-sys.float_info.max)
spin_box.setMaximum(sys.float_info.max)
spin_box.setDisabled(True)
check_box.toggled.connect(spin_box.setEnabled)
return check_box, spin_box
示例4: _create
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def _create(self, base_frame):
self.sliders = []
self.spinboxes = []
for i in range(len(self.dim_labels)):
self.sliders.append(QtGui.QSlider(QtCore.Qt.Horizontal))
self.sliders[i].setRange(0, self.n_slider_steps[i])
self.connect(self.sliders[i],
QtCore.SIGNAL("valueChanged(int)"),
partial(self._on_slide, i))
spinbox = QtGui.QDoubleSpinBox()
spinbox.setRange(*self.limits[i])
spinbox.setDecimals(3)
spinbox.setSingleStep(0.001)
self.spinboxes.append(spinbox)
self.connect(self.spinboxes[i],
QtCore.SIGNAL("valueChanged(double)"),
partial(self._on_pos_edited, i))
slider_group = QtGui.QGridLayout()
slider_group.addWidget(QtGui.QLabel("Position"),
0, 0, 1, 3, QtCore.Qt.AlignCenter)
slider_group.addWidget(QtGui.QLabel("Orientation (Euler angles)"),
0, 3, 1, 3, QtCore.Qt.AlignCenter)
for i, slider in enumerate(self.sliders):
slider_group.addWidget(QtGui.QLabel(self.dim_labels[i]), 1, i)
slider_group.addWidget(slider, 2, i)
slider_group.addWidget(self.spinboxes[i], 3, i)
slider_groupbox = QtGui.QGroupBox("Transformation in frame '%s'"
% base_frame)
slider_groupbox.setLayout(slider_group)
layout = QtGui.QHBoxLayout()
layout.addWidget(slider_groupbox)
layout.addStretch(1)
return layout
示例5: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def __init__(self, dataitem, parent=None):
super(numericPanel, self).__init__(parent)
self.setFrameStyle(widgets.QFrame.Sunken)
self.setFrameShape(widgets.QFrame.Box)
self.data = dataitem
layout = widgets.QGridLayout()
labelnob = widgets.QLabel(_("Number of bit"))
lableunit = widgets.QLabel(_("Unit"))
labelsigned = widgets.QLabel(_("Signed"))
labelformat = widgets.QLabel(_("Format"))
labeldoc = widgets.QLabel(_("Value = (AX+B) / C"))
labela = widgets.QLabel("A")
labelb = widgets.QLabel("B")
labelc = widgets.QLabel("C")
layout.addWidget(labelnob, 0, 0)
layout.addWidget(lableunit, 1, 0)
layout.addWidget(labelsigned, 2, 0)
layout.addWidget(labelformat, 3, 0)
layout.addWidget(labeldoc, 4, 0)
layout.addWidget(labela, 5, 0)
layout.addWidget(labelb, 6, 0)
layout.addWidget(labelc, 7, 0)
layout.setRowStretch(8, 1)
self.inputnob = widgets.QSpinBox()
self.inputnob.setRange(1, 32)
self.inputunit = widgets.QLineEdit()
self.inputsigned = widgets.QCheckBox()
self.inputformat = widgets.QLineEdit()
self.inputa = widgets.QDoubleSpinBox()
self.inputb = widgets.QDoubleSpinBox()
self.inputc = widgets.QDoubleSpinBox()
self.inputc.setRange(-1000000, 1000000)
self.inputb.setRange(-1000000, 1000000)
self.inputa.setRange(-1000000, 1000000)
self.inputa.setDecimals(4)
self.inputb.setDecimals(4)
self.inputc.setDecimals(4)
layout.addWidget(self.inputnob, 0, 1)
layout.addWidget(self.inputunit, 1, 1)
layout.addWidget(self.inputsigned, 2, 1)
layout.addWidget(self.inputformat, 3, 1)
layout.addWidget(self.inputa, 5, 1)
layout.addWidget(self.inputb, 6, 1)
layout.addWidget(self.inputc, 7, 1)
self.setLayout(layout)
self.init()
示例6: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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()
示例7: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
def __init__(self, parent, slice_view_widget, context):
super(PlotExportSettingsWidget, self).__init__(parent)
self._slice_view_widget = slice_view_widget
self._context = context
self._dpi_units = ["in", "cm", "px"]
if parent is None or self._slice_view_widget is None:
w, h, dpi = 11.7, 8.3, 100
else:
fig = self._slice_view_widget.layout_figure()
w, h = fig.get_size_inches()
dpi = fig.dpi
self._label = QLabel()
self._label.setDisabled(True)
self._set_label_txt(w, h, self._dpi_units[0])
self._fix_size = QCheckBox()
self._fix_width = QDoubleSpinBox()
self._fix_width.setDisabled(True)
self._fix_height = QDoubleSpinBox()
self._fix_height.setDisabled(True)
self._fix_dpi_units = QComboBox()
self._fix_dpi_units.setDisabled(True)
self._fix_width.setMinimum(1)
self._fix_width.setMaximum(32000)
self._fix_width.setValue(w)
self._fix_height.setMinimum(1)
self._fix_height.setMaximum(32000)
self._fix_height.setValue(h)
self._fix_width.valueChanged.connect(self._fixed_image)
self._fix_height.valueChanged.connect(self._fixed_image)
self._fix_dpi_units.addItems(self._dpi_units)
self._fix_dpi_units.activated.connect(self._fixed_image)
self._fix_size.toggled.connect(self._fixed_image)
self._label_widget = self._label
self._enable_widget = self._fix_size
self._dpi_widget = self._fix_dpi_units
self._height_widget = self._fix_height
self._width_widget = self._fix_width