LCD number walking in Qtruby


Yes, I'm using E17

"All the people, so many people, they all go hand in hand, hand in hand through their parklife "
Blur - Parklife

Yes, I writed the LCD Number walking for the QtRuby, let see the code:
require 'Qt4'
class All < Qt::Widget
def initialize()
super()
setFixedSize(120, 250)
lcd = Qt::LCDNumber.new(2)
slider = Qt::Slider.new(Qt::Horizontal)
slider.setRange(0, 99)
slider.setValue(0)

connect(slider, SIGNAL('valueChanged(int)'), lcd, SLOT('display(int)'))
layout = Qt::VBoxLayout.new()
layout.addWidget(lcd)
layout.addWidget(slider)
setLayout(layout)
end
end

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

0 comentários: