require "qt2"
include Qt2

appli = QApplication.new([$0]+ARGV)

palette = QApplication::palette()
palette.setColor(QColorGroup::ButtonText,Qt::red)
palette.setColor(QColorGroup::Text,Qt::magenta)
QApplication::setPalette(palette)

root = QWidget.new
qvbox = QVBox.new(root)

button = QPushButton.new("Red Button",qvbox)
connect(button,QSIGNAL("clicked()"),appli,QSLOT("quit()"))

button2 = QPushButton.new("Blue Button",qvbox)
palette = button2.palette
palette.setColor(QColorGroup::ButtonText,Qt::blue)
button2.setPalette(palette)
connect(button2,QSIGNAL("clicked()"),appli,QSLOT("quit()"))

label = QLabel.new("Label is <font color=green>Green</font>", qvbox)
label2 = QLabel.new( "Label is <font color=black size=+2><u>Black</u></font>", qvbox)

qvbox.adjustSize
root.adjustSize

appli.setMainWidget(root)
root.show

appli.exec

