summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/tutorial/t13/gamebrd.rb
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/tutorial/t13/gamebrd.rb
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/tutorial/t13/gamebrd.rb')
-rw-r--r--qtruby/rubylib/tutorial/t13/gamebrd.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/qtruby/rubylib/tutorial/t13/gamebrd.rb b/qtruby/rubylib/tutorial/t13/gamebrd.rb
index dc993927..46cc10c5 100644
--- a/qtruby/rubylib/tutorial/t13/gamebrd.rb
+++ b/qtruby/rubylib/tutorial/t13/gamebrd.rb
@@ -1,15 +1,15 @@
-require 'Qt'
-require 'lcdrange.rb'
-require 'cannon.rb'
+retquire 'Qt'
+retquire 'lcdrange.rb'
+retquire 'cannon.rb'
-class GameBoard < Qt::Widget
+class GameBoard < TQt::Widget
slots 'fire()', 'hit()', 'missed()', 'newGame()'
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()'))
@@ -36,34 +36,34 @@ class GameBoard < Qt::Widget
connect( @cannonField, SIGNAL('missed()'),
self, SLOT('missed()') )
- shoot = Qt::PushButton.new( '&Shoot', self, 'shoot' )
- shoot.setFont( Qt::Font.new( 'Times', 18, Qt::Font::Bold ) )
+ shoot = TQt::PushButton.new( '&Shoot', self, 'shoot' )
+ shoot.setFont( TQt::Font.new( 'Times', 18, TQt::Font::Bold ) )
connect( shoot, SIGNAL('clicked()'), SLOT('fire()') )
connect( @cannonField, SIGNAL('canShoot(bool)'),
shoot, SLOT('setEnabled(bool)') )
- restart = Qt::PushButton.new( '&New Game', self, 'newgame' )
- restart.setFont( Qt::Font.new( 'Times', 18, Qt::Font::Bold ) )
+ restart = TQt::PushButton.new( '&New Game', self, 'newgame' )
+ restart.setFont( TQt::Font.new( 'Times', 18, TQt::Font::Bold ) )
connect( restart, SIGNAL('clicked()'), self, SLOT('newGame()') )
- @hits = Qt::LCDNumber.new( 2, self, 'hits' )
- @shotsLeft = Qt::LCDNumber.new( 2, self, 'shotsleft' )
- hitsL = Qt::Label.new( 'HITS', self, 'hitsLabel' )
- shotsLeftL = Qt::Label.new( 'SHOTS LEFT', self, 'shotsleftLabel' )
+ @hits = TQt::LCDNumber.new( 2, self, 'hits' )
+ @shotsLeft = TQt::LCDNumber.new( 2, self, 'shotsleft' )
+ hitsL = TQt::Label.new( 'HITS', self, 'hitsLabel' )
+ shotsLeftL = TQt::Label.new( 'SHOTS LEFT', self, 'shotsleftLabel' )
- grid = Qt::GridLayout.new( self, 2, 2, 10 )
+ grid = TQt::GridLayout.new( self, 2, 2, 10 )
grid.addWidget( quit, 0, 0 )
grid.addWidget( @cannonField, 1, 1 )
grid.setColStretch( 1, 10 )
- leftBox = Qt::VBoxLayout.new()
+ leftBox = TQt::VBoxLayout.new()
grid.addLayout( leftBox, 1, 0 )
leftBox.addWidget( angle )
leftBox.addWidget( force )
- topBox = Qt::HBoxLayout.new()
+ topBox = TQt::HBoxLayout.new()
grid.addLayout( topBox, 0, 1 )
topBox.addWidget( shoot )
topBox.addWidget( @hits )