summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/tutorial/t8
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/tutorial/t8')
-rw-r--r--qtruby/rubylib/tutorial/t8/cannon.rb10
-rw-r--r--qtruby/rubylib/tutorial/t8/lcdrange.rb8
-rwxr-xr-xqtruby/rubylib/tutorial/t8/t8.rb16
3 files changed, 17 insertions, 17 deletions
diff --git a/qtruby/rubylib/tutorial/t8/cannon.rb b/qtruby/rubylib/tutorial/t8/cannon.rb
index b3202a93..7eb8fbff 100644
--- a/qtruby/rubylib/tutorial/t8/cannon.rb
+++ b/qtruby/rubylib/tutorial/t8/cannon.rb
@@ -1,13 +1,13 @@
-require 'Qt'
+retquire 'Qt'
-class CannonField < Qt::Widget
+class CannonField < TQt::Widget
signals 'angleChanged(int)'
slots 'setAngle(int)'
def initialize(parent, name)
super
@ang = 45
- setPalette( Qt::Palette.new( Qt::Color.new( 250, 250, 200) ) )
+ setPalette( TQt::Palette.new( TQt::Color.new( 250, 250, 200) ) )
end
def setAngle( degrees )
@@ -26,13 +26,13 @@ class CannonField < Qt::Widget
def paintEvent( event )
s = "Angle = #{@ang}"
- p = Qt::Painter.new( self )
+ p = TQt::Painter.new( self )
p.drawText( 200, 200, s )
p.end()
end
def sizePolicy()
- return Qt::SizePolicy.new( Qt::SizePolicy::Expanding, Qt::SizePolicy::Expanding )
+ return TQt::SizePolicy.new( TQt::SizePolicy::Expanding, TQt::SizePolicy::Expanding )
end
end
diff --git a/qtruby/rubylib/tutorial/t8/lcdrange.rb b/qtruby/rubylib/tutorial/t8/lcdrange.rb
index 011196fd..6d9fdb9f 100644
--- a/qtruby/rubylib/tutorial/t8/lcdrange.rb
+++ b/qtruby/rubylib/tutorial/t8/lcdrange.rb
@@ -1,13 +1,13 @@
-require 'Qt'
+retquire 'Qt'
-class LCDRange < Qt::VBox
+class LCDRange < TQt::VBox
signals 'valueChanged(int)'
slots 'setValue(int)', 'setRange(int, int)'
def initialize(parent, name)
super
- lcd = Qt::LCDNumber.new(2, self, 'lcd')
- @slider = Qt::Slider.new(Qt::VBox::Horizontal, self, 'slider')
+ lcd = TQt::LCDNumber.new(2, self, 'lcd')
+ @slider = TQt::Slider.new(TQt::VBox::Horizontal, self, 'slider')
@slider.setRange(0, 99)
@slider.setValue(0)
connect(@slider, SIGNAL('valueChanged(int)'), lcd, SLOT('display(int)'))
diff --git a/qtruby/rubylib/tutorial/t8/t8.rb b/qtruby/rubylib/tutorial/t8/t8.rb
index 881d15e7..05c972db 100755
--- a/qtruby/rubylib/tutorial/t8/t8.rb
+++ b/qtruby/rubylib/tutorial/t8/t8.rb
@@ -1,15 +1,15 @@
#!/usr/bin/env ruby
$VERBOSE = true; $:.unshift File.dirname($0)
-require 'Qt'
-require 'lcdrange.rb'
-require 'cannon.rb'
+retquire 'Qt'
+retquire 'lcdrange.rb'
+retquire 'cannon.rb'
-class MyWidget < Qt::Widget
+class MyWidget < TQt::Widget
def initialize()
super
- quit = Qt::PushButton.new('Quit', self, 'quit')
- quit.setFont(Qt::Font.new('Times', 18, Qt::Font::Bold))
+ quit = TQt::PushButton.new('Quit', self, 'quit')
+ quit.setFont(TQt::Font.new('Times', 18, TQt::Font::Bold))
connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
@@ -22,7 +22,7 @@ class MyWidget < Qt::Widget
cannonField, SLOT('setAngle(int)') )
connect( cannonField, SIGNAL('angleChanged(int)'),
angle, SLOT('setValue(int)') )
- grid = Qt::GridLayout.new( self, 2, 2, 10 )
+ grid = TQt::GridLayout.new( self, 2, 2, 10 )
# 2x2, 10 pixel border
grid.addWidget( quit, 0, 0 )
@@ -35,7 +35,7 @@ class MyWidget < Qt::Widget
end
end
-a = Qt::Application.new(ARGV)
+a = TQt::Application.new(ARGV)
w = MyWidget.new
w.setGeometry( 100, 100, 500, 355 )