diff options
Diffstat (limited to 'qtruby/rubylib/tutorial/t13/gamebrd.rb')
-rw-r--r-- | qtruby/rubylib/tutorial/t13/gamebrd.rb | 34 |
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 ) |