Sha256: 4f664254db58bc7d30dec8d529c5f0c0e98afed04a47bd63e20451867e724fc4

Contents?: true

Size: 1.01 KB

Versions: 22

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby
$VERBOSE = true; $:.unshift File.dirname($0)

require 'Qt'

class LCDRange < Qt::Widget

def initialize(parent = nil)
    super
    lcd = Qt::LCDNumber.new(2)
    slider = Qt::Slider.new(Qt::Horizontal)
    slider.range = 0..99
    slider.value = 0

    lcd.connect(slider, SIGNAL('valueChanged(int)'), SLOT('display(int)'))

    layout = Qt::VBoxLayout.new
    layout.addWidget(lcd)
    layout.addWidget(slider)
    setLayout(layout)
end

end

class MyWidget < Qt::Widget

def initialize()
    super
    quit = Qt::PushButton.new('Quit')
    quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
    connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))

    grid = Qt::GridLayout.new
	
    for row in 0..3
        for column in 0..3
            grid.addWidget(LCDRange.new, row, column)
        end
    end

    layout = Qt::VBoxLayout.new
    layout.addWidget(quit)
    layout.addLayout(grid)
    setLayout(layout)
end

end    

app = Qt::Application.new(ARGV)
widget = MyWidget.new
widget.show
app.exec

Version data entries

22 entries across 20 versions & 2 rubygems

Version Path
qtbindings-4.8.6.2 examples/tutorial/t6/t6.rb
qtbindings-4.8.6.1 examples/tutorial/t6/t6.rb
qtbindings-4.8.6.0 examples/tutorial/t6/t6.rb
qtbindings-4.8.6.0-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.8.5.2 examples/tutorial/t6/t6.rb
qtbindings-4.8.5.2-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.8.5.1 examples/tutorial/t6/t6.rb
qtbindings-4.8.5.0 examples/tutorial/t6/t6.rb
qtbindings-4.8.3.0-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.8.3.0 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.4-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.4 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.3 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.2-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.2 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.1 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.1-x86-mingw32 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.0 examples/tutorial/t6/t6.rb
qtbindings-4.6.3.0 ext/ruby/qtruby/examples/tutorial/t6/t6.rb
qtbindings-4.6.3.0-x86-mingw32 examples/tutorial/t6/t6.rb