QT GUI Slider variable_qtgui_slider QT GUI Widgets from PyQt4 import Qt import PyQt4.Qwt5 as Qwt self.$(id) = $(id) = $value #set $win = '_%s_layout'%$id $win = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom) self._$(id)_tool_bar = Qt.QToolBar(self) $(win).addWidget(self._$(id)_tool_bar) #if not $label() #set $label = '"%s"'%$id #end if self._$(id)_tool_bar.addWidget(Qt.QLabel($label, None)) self._$(id)_counter = Qwt.QwtCounter(None) self._$(id)_counter.setRange($start, $stop, $step) self._$(id)_counter.setNumButtons(2) self._$(id)_counter.setValue($value) self._$(id)_tool_bar.addWidget(self._$(id)_counter) self._$(id)_counter.valueChanged.connect(self.set_$(id)) self._$(id)_slider = Qwt.QwtSlider(None) self._$(id)_slider.setRange($start, $stop, $step) self._$(id)_slider.setValue($value) self._$(id)_slider.setOrientation(Qt.$orient) self._$(id)_slider.setScalePosition($orient.scalepos) self._$(id)_slider.valueChanged.connect(self.set_$(id)) $(win).addWidget(self._$(id)_slider) $(gui_hint()($win)) self.set_$(id)($value) self._$(id)_counter.setValue($id) self._$(id)_slider.setValue($id) Label label string #if $label() then 'none' else 'part'# Default Value value 50 real Start start 0 real Stop stop 100 real Step step 1 real Orientation orient Qt.Horizontal enum part GUI Hint gui_hint gui_hint part $start <= $value <= $stop $start < $stop This block creates a variable with a slider. \ Leave the label blank to use the variable id as the label. \ The value must be a real number. \ The value must be between the start and the stop. The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ Both the tab specification and the grid position are optional.