Python PySide.QtGui.QSlider() Examples

The following are 12 code examples of PySide.QtGui.QSlider(). 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 PySide.QtGui , or try the search function .
Example #1
Source File: scroll_gui.py    From FRETBursts with GNU General Public License v2.0 6 votes vote down vote up
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) 
Example #2
Source File: Zebra_Gui.py    From CurvesWB with GNU Lesser General Public License v2.1 5 votes vote down vote up
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) 
Example #3
Source File: timetrace_scroll_demo.py    From FRETBursts with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #4
Source File: timetrace_scroll_pygraphqt.py    From FRETBursts with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #5
Source File: timetrace_scroll_demo2.py    From FRETBursts with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #6
Source File: timetrace_scroll_demo3.py    From FRETBursts with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #7
Source File: QtShim.py    From grap with MIT License 5 votes vote down vote up
def get_QSlider():
    """QSlider getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QSlider
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QSlider 
Example #8
Source File: animate_constraint.py    From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 5 votes vote down vote up
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) 
Example #9
Source File: onionSkinRendererWindow.py    From onionSkinRenderer with MIT License 5 votes vote down vote up
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)

    # 
Example #10
Source File: onionSkinRendererWindow.py    From onionSkinRenderer with MIT License 5 votes vote down vote up
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)
    
    # 
Example #11
Source File: transform.py    From Animation with GNU General Public License v2.0 5 votes vote down vote up
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") 
Example #12
Source File: SurfaceEdit.py    From CurvesWB with GNU Lesser General Public License v2.1 4 votes vote down vote up
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)