Class: SlidersGroup
- Defined in:
- ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb
Instance Method Summary collapse
-
#initialize(orientation, title, parent = nil) ⇒ SlidersGroup
constructor
A new instance of SlidersGroup.
- #invertAppearance(invert) ⇒ Object
- #invertKeyBindings(invert) ⇒ Object
- #minimum=(value) ⇒ Object
- #setMaximum(value) ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(orientation, title, parent = nil) ⇒ SlidersGroup
Returns a new instance of SlidersGroup.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 37 def initialize(orientation, title, parent = nil) super(title, parent) @slider = Qt::Slider.new(orientation) @slider.focusPolicy = Qt::StrongFocus @slider.tickPosition = Qt::Slider::TicksBothSides @slider.tickInterval = 10 @slider.singleStep = 1 @scrollBar = Qt::ScrollBar.new(orientation) @scrollBar.focusPolicy = Qt::StrongFocus @dial = Qt::Dial.new @dial.focusPolicy = Qt::StrongFocus connect(@slider, SIGNAL('valueChanged(int)'), @scrollBar, SLOT('setValue(int)')) connect(@scrollBar, SIGNAL('valueChanged(int)'), @dial, SLOT('setValue(int)')) connect(@dial, SIGNAL('valueChanged(int)'), @slider, SLOT('setValue(int)')) connect(@dial, SIGNAL('valueChanged(int)'), self, SIGNAL('valueChanged(int)')) if orientation == Qt::Horizontal direction = Qt::BoxLayout::TopToBottom else direction = Qt::BoxLayout::LeftToRight end @slidersLayout = Qt::BoxLayout.new(direction) do |l| l.addWidget(@slider) l.addWidget(@scrollBar) l.addWidget(@dial) end setLayout(@slidersLayout) end |
Instance Method Details
#invertAppearance(invert) ⇒ Object
86 87 88 89 90 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 86 def invertAppearance(invert) @slider.invertedAppearance = invert @scrollBar.invertedAppearance = invert @dial.invertedAppearance = invert end |
#invertKeyBindings(invert) ⇒ Object
92 93 94 95 96 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 92 def invertKeyBindings(invert) @slider.invertedControls = invert @scrollBar.invertedControls = invert @dial.invertedControls = invert end |
#minimum=(value) ⇒ Object
74 75 76 77 78 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 74 def minimum=(value) @slider.minimum = value @scrollBar.minimum = value @dial.minimum = value end |
#setMaximum(value) ⇒ Object
80 81 82 83 84 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 80 def setMaximum(value) @slider.maximum = value @scrollBar.maximum = value @dial.maximum = value end |
#value=(value) ⇒ Object
70 71 72 |
# File 'ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb', line 70 def value=(value) @slider.value = value end |