The full example follows. The lines that appear not be be working are the ones that start with:
###
N.B.: No error message is produced if they are enabled, there just isn't any effect.
I'm running Debian etch with libqt4-ruby 1.4.7-1 (etc. current as of 08:00 PDT 2007/09/16)
class TestWidget < Qt::Widget
def initialize(parent = nil)
super
quit = Qt::PushButton.new("Quit")
quit.setGeometry(62, 40, 75, 30)
quit.font = Qt::Font.new("Penguin Attack", 18, Qt::Font::Bold)
connect(quit, SIGNAL("clicked()"), $qApp, SLOT("quit()"))
lcd = Qt::LCDNumber.new(2)
#### Don't know why the following section doesn't work
###lcd.setSegmentStyle(Qt::LCDNumber::Filled)
###fontLCD = Qt::Font.new("Times", 18, Qt::Font::Bold)
###fontLCD.setWeight(75)
###lcd.setFont(fontLCD)
slider = Qt::Slider.new(Qt::Horizontal)
slider.setRange(0, 99)
slider.value = 0
connect(slider, SIGNAL("valueChanged(int)"), lcd, SLOT("display(int)"))
layout = Qt::VBoxLayout.new
layout.addWidget(quit)
layout.addWidget(lcd)
layout.addWidget(slider)
setLayout(layout)
end # initialize
end # TestWidget
app = Qt::Application.new(ARGV)
widget= TestWidget.new()
widget.show
|