本文整理汇总了Python中PySide.QtGui.QSlider方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QSlider方法的具体用法?Python QtGui.QSlider怎么用?Python QtGui.QSlider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QSlider方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_slider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def set_slider(self, parent):
# Note: slider controls the position of xmin, so its range is
# between `data_xmin` and `data_xmax - width`.
if self.debug:
pprint('ScrollingToolQT set_slider\n')
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, parent=parent)
self.slider.setTickPosition(QtGui.QSlider.TicksAbove)
self.slider.setMinimum(self.data_xmin * self.scale)
self.slider.setMaximum(self.data_xmax * self.scale)
self.slider.setTickInterval(
(self.data_xmax - self.data_xmin) / 10 * self.scale)
self.slider.setSingleStep(self.width * self.scale * self.scroll_single)
self.slider.setPageStep(self.width * self.scale * self.scroll_page)
self.slider.setValue(self.xmin * self.scale) # set initial position
self.slider.valueChanged.connect(self.slider_changed)
parent.addWidget(self.slider)
示例2: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def setupUi(self, Zebra):
Zebra.setObjectName(_fromUtf8("Zebra"))
Zebra.resize(241, 302)
self.verticalLayoutWidget = QtGui.QWidget(Zebra)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.label = QtGui.QLabel(self.verticalLayoutWidget)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
self.verticalLayout.addWidget(self.horizontalSlider)
self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
self.verticalLayout.addWidget(self.horizontalSlider_2)
self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
self.verticalLayout.addWidget(self.horizontalSlider_3)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)
self.retranslateUi(Zebra)
# QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
# QtCore.QMetaObject.connectSlotsByName(Zebra)
示例3: set_slider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def set_slider(self, parent):
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, parent=parent)
self.slider.setTickPosition(QtGui.QSlider.TicksAbove)
self.slider.setTickInterval((self.xmax-self.xmin)/10.*self.scale)
self.slider.setMinimum(self.xmin*self.scale)
self.slider.setMaximum((self.xmax-self.width)*self.scale)
self.slider.setSingleStep(self.width*self.scale/4.)
self.slider.setPageStep(self.scroll_step*self.width*self.scale)
self.slider.setValue(self.pos*self.scale) # set the initial position
self.slider.valueChanged.connect(self.xpos_changed)
parent.addWidget(self.slider)
示例4: set_slider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def set_slider(self, parent):
# Slider only support integer ranges so use ms as base unit
smin, smax = self.xmin*self.scale, self.xmax*self.scale
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, parent=parent)
self.slider.setTickPosition(QtGui.QSlider.TicksAbove)
self.slider.setTickInterval((smax-smin)/10.)
self.slider.setMinimum(smin)
self.slider.setMaximum(smax-self.step*self.scale)
self.slider.setSingleStep(self.step*self.scale/5.)
self.slider.setPageStep(self.step*self.scale)
self.slider.setValue(0) # set the initial position
self.slider.valueChanged.connect(self.xpos_changed)
parent.addWidget(self.slider)
示例5: set_slider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def set_slider(self, parent):
# Slider only support integer ranges so use ms as base unit
smin, smax = self.xmin*self.scale, self.xmax*self.scale
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, parent=parent)
self.slider.setTickPosition(QtGui.QSlider.TicksAbove)
self.slider.setTickInterval((smax-smin)/10.)
self.slider.setMinimum(smin)
self.slider.setMaximum(smax-self.width*self.scale)
self.slider.setSingleStep(self.width*self.scale/5.)
self.slider.setPageStep(self.width*self.scale)
self.slider.setValue(0) # set the initial position
self.slider.valueChanged.connect(self.xpos_changed)
parent.addWidget(self.slider)
示例6: set_slider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def set_slider(self, parent):
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, parent=parent)
self.slider.setTickPosition(QtGui.QSlider.TicksAbove)
self.slider.setTickInterval((self.xmax-self.xmin)/10.*self.scale)
self.slider.setMinimum(self.xmin*self.scale)
self.slider.setMaximum((self.xmax-self.plot_width)*self.scale)
self.slider.setSingleStep(self.plot_width*self.scale/4.)
self.slider.setPageStep(self.scroll_step*self.plot_width*self.scale)
self.slider.setValue(0) # set the initial position
self.slider.valueChanged.connect(self.xpos_changed)
parent.addWidget(self.slider)
示例7: get_QSlider
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def get_QSlider():
"""QSlider getter."""
try:
import PySide.QtGui as QtGui
return QtGui.QSlider
except ImportError:
import PyQt5.QtWidgets as QtWidgets
return QtWidgets.QSlider
示例8: initUI
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def initUI(self):
vbox = QtGui.QVBoxLayout()
hbox = QtGui.QHBoxLayout()
#hbox2.addStretch(1)
self.playStopButton = QtGui.QPushButton() #QtGui.QToolButton()
self.playStopButton.setIcon( QtGui.QIcon(':/assembly2/icons/play.svg') )
self.playStopButton.clicked.connect( self.playStopButton_clicked )
self.playStopButton.setFlat( True )
self.playStopButton.setMaximumWidth( 20 )
self.playStopButton.setEnabled( False )
#self.stopButton.setIcon( QtGui.QIcon(':/haas_mill/icons/stop.svg') )
self.animationSlider = QtGui.QSlider( QtCore.Qt.Orientation.Horizontal )
self.animationSlider.setMaximum(160)
self.animationSlider.sliderMoved.connect( self.slider_moved )
self.animationSlider.setEnabled( False )
#self.animationSlider.sliderMoved.connect( self.slider_moved )
hbox.addWidget( self.animationSlider )
hbox.addWidget( self.playStopButton )
vbox.addLayout( hbox )
#operation parameters
self.parameterDict = {}
constraint_to_animate = self.taskDialog.constraint_to_animate
for widgetManager in animation_parameters: #or widgetConstructors or widgetMangers or ...
w = widgetManager.generateWidget( self.parameterDict, constraint_to_animate )
if isinstance(w, QtGui.QLayout):
vbox.addLayout( w )
else:
vbox.addWidget( w )
self.button_generate_animiation = QtGui.QPushButton('Generate')
self.button_generate_animiation.clicked.connect( self.generate_animation )
vbox.addWidget( self.button_generate_animiation )
self.setLayout(vbox)
示例9: toggleRelativeFrame
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def toggleRelativeFrame(self):
sender = self.sender()
frame = sender.parent().findChild(QtGui.QLabel, 'frame_number').text()
sliderValue = sender.parent().findChild(QtGui.QSlider, 'frame_opacity_slider').value()
if sender.isChecked():
onionCore.viewRenderOverrideInstance.addRelativeOnion(frame, sliderValue)
else:
onionCore.viewRenderOverrideInstance.removeRelativeOnion(frame)
#
示例10: toggleAbsoluteFrame
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def toggleAbsoluteFrame(self):
sender = self.sender()
frame = sender.parent().findChild(QtGui.QLabel, 'frame_number').text()
sliderValue = sender.parent().findChild(QtGui.QSlider, 'frame_opacity_slider').value()
if sender.isChecked():
onionCore.viewRenderOverrideInstance.addAbsoluteOnion(frame, sliderValue)
else:
onionCore.viewRenderOverrideInstance.removeAbsoluteOnion(frame)
#
示例11: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def __init__(self, obj,*args):
QtGui.QWidget.__init__(self, *args)
self.Object=obj
layout = QtGui.QGridLayout()
# self.vollabel = QtGui.QLabel("Telescopic boom")
# layout.addWidget(self.vollabel, 0, 0)
self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, self)
self.slider.setMaximum(100)
self.slider.valueChanged.connect(self.paramValueCanged);
layout.addWidget(self.slider, 12, 0,1,4)
self.setLayout(layout)
self.setWindowTitle("Telecopic Boom")
示例12: initUI
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QSlider [as 别名]
def initUI(self):
self.getSelection()
self.value = 99
self.sliderRange = 100
self.val = QtGui.QLabel(self)
self.val.setText('Surface Display')
self.val.setGeometry(80, 15, 180, 30)
sld = QtGui.QSlider(QtCore.Qt.Horizontal, self)
sld.setFocusPolicy(QtCore.Qt.NoFocus)
sld.setMaximum(self.sliderRange)
sld.setGeometry(30, 40, 200, 30)
sld.setValue(99)
sld.valueChanged[int].connect(self.changeComplexity)
self.txt = QtGui.QLabel(self)
self.txt.setText('Fast Fine')
self.txt.setGeometry(30, 55, 240, 30)
self.value2 = 0
self.sliderRange2 = 100
self.val2 = QtGui.QLabel(self)
self.val2.setText('Surface Transparency')
self.val2.setGeometry(80, 140, 180, 30)
sld2 = QtGui.QSlider(QtCore.Qt.Horizontal, self)
sld2.setFocusPolicy(QtCore.Qt.NoFocus)
sld2.setMaximum(self.sliderRange2)
sld2.setGeometry(30, 160, 200, 30)
sld2.valueChanged[int].connect(self.changeTransparency)
self.txt2 = QtGui.QLabel(self)
self.txt2.setText('0 100')
self.txt2.setGeometry(30, 175, 240, 30)
self.OKButton = QtGui.QPushButton("OK",self)
self.OKButton.clicked.connect(self.activate)
self.OKButton.setAutoDefault(False)
self.OKButton.move(30, 260)
self.cancelButton = QtGui.QPushButton('Quit', self)
self.cancelButton.clicked.connect(self.onCancel)
self.cancelButton.setAutoDefault(True)
self.cancelButton.move(130, 260)
FreeCAD.Console.PrintMessage("InitUI OK\n")
self.doc1 = QtGui.QLabel(self)
self.doc1.setText('\'g\' : Grab selected poles')
self.doc1.setGeometry(30, 340, 180, 30)
self.doc2 = QtGui.QLabel(self)
self.doc2.setText('\'x\',\'y\',\'z\' : Axis constraint')
self.doc2.setGeometry(30, 380, 180, 30)