Sha256: d9f6f3c2c4b64d726fdf4bd862b9337d5011818f36b21fe63a5cea2fd027c83d
Contents?: true
Size: 795 Bytes
Versions: 7
Compression:
Stored size: 795 Bytes
Contents
#!/usr/bin/env ruby $VERBOSE = true; $:.unshift File.dirname($0) require 'Qt' 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()')) lcd = Qt::LCDNumber.new(2) slider = Qt::Slider.new(Qt::Horizontal) slider.range = 0..99 slider.value = 0 connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()')) 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 end app = Qt::Application.new(ARGV) widget = MyWidget.new widget.show app.exec
Version data entries
7 entries across 7 versions & 2 rubygems