diff options
Diffstat (limited to 'qtjava/javalib/tutorial/t14/GameBoard.java')
-rw-r--r-- | qtjava/javalib/tutorial/t14/GameBoard.java | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/qtjava/javalib/tutorial/t14/GameBoard.java b/qtjava/javalib/tutorial/t14/GameBoard.java index 46efa2eb..571e902e 100644 --- a/qtjava/javalib/tutorial/t14/GameBoard.java +++ b/qtjava/javalib/tutorial/t14/GameBoard.java @@ -1,14 +1,14 @@ import org.kde.qt.*; -public class GameBoard extends QWidget { - private QLCDNumber hits; - private QLCDNumber shotsLeft; +public class GameBoard extends TQWidget { + private TQLCDNumber hits; + private TQLCDNumber shotsLeft; private CannonField cannonField; public GameBoard() { super(null, "gameboard"); - QPushButton quit = new QPushButton("&Quit", this, "quit"); - quit.setFont(new QFont("Times", 18, QFont.Bold, false)); + TQPushButton quit = new TQPushButton("&Quit", this, "quit"); + quit.setFont(new TQFont("Times", 18, TQFont.Bold, false)); connect(quit, SIGNAL("clicked()"), qApp(), SLOT("quit()")); @@ -18,8 +18,8 @@ public class GameBoard extends QWidget { LCDRange force = new LCDRange("FORCE", this, "force"); force.setRange(10, 50); - QVBox box = new QVBox(this, "cannonFrame"); - box.setFrameStyle(QFrame.WinPanel | QFrame.Sunken); + TQVBox box = new TQVBox(this, "cannonFrame"); + box.setFrameStyle(TQFrame.WinPanel | TQFrame.Sunken); cannonField = new CannonField(box, "cannonField"); @@ -38,41 +38,41 @@ public class GameBoard extends QWidget { connect(cannonField, SIGNAL("missed()"), this, SLOT("missed()")); - QPushButton shoot = new QPushButton("&Shoot", this, "shoot"); - shoot.setFont(new QFont("Times", 18, QFont.Bold, false)); + TQPushButton shoot = new TQPushButton("&Shoot", this, "shoot"); + shoot.setFont(new TQFont("Times", 18, TQFont.Bold, false)); connect(shoot, SIGNAL("clicked()"), SLOT("fire()")); - QPushButton restart = new QPushButton("&New Game", this, "newgame"); - restart.setFont(new QFont("Times", 18, QFont.Bold, false)); + TQPushButton restart = new TQPushButton("&New Game", this, "newgame"); + restart.setFont(new TQFont("Times", 18, TQFont.Bold, false)); connect(restart, SIGNAL("clicked()"), this, SLOT("newGame()")); - hits = new QLCDNumber(2, this, "hits"); - shotsLeft = new QLCDNumber(2, this, "shotsleft"); - QLabel hitsL = new QLabel("HITS", this, "hitsLabel", 0); - QLabel shotsLeftL = new QLabel("SHOTS LEFT", this, "shotsleftLabel", 0); + hits = new TQLCDNumber(2, this, "hits"); + shotsLeft = new TQLCDNumber(2, this, "shotsleft"); + TQLabel hitsL = new TQLabel("HITS", this, "hitsLabel", 0); + TQLabel shotsLeftL = new TQLabel("SHOTS LEFT", this, "shotsleftLabel", 0); - QAccel accel = new QAccel(this); - accel.connectItem(accel.insertItem(new QKeySequence(Key_Enter)), this, SLOT("fire()")); - accel.connectItem(accel.insertItem(new QKeySequence(Key_Return)), this, SLOT("fire()")); - accel.connectItem(accel.insertItem(new QKeySequence(CTRL+Key_Q)), qApp(), SLOT("quit()")); + TQAccel accel = new TQAccel(this); + accel.connectItem(accel.insertItem(new TQKeySequence(Key_Enter)), this, SLOT("fire()")); + accel.connectItem(accel.insertItem(new TQKeySequence(Key_Return)), this, SLOT("fire()")); + accel.connectItem(accel.insertItem(new TQKeySequence(CTRL+Key_Q)), qApp(), SLOT("quit()")); /*** accel.connectItem(accel.insertItem(Key_Enter), this, SLOT("fire()")); accel.connectItem(accel.insertItem(Key_Return), this, SLOT("fire()")); accel.connectItem(accel.insertItem(CTRL+Key_Q), qApp(), SLOT("quit()")); ***/ - QGridLayout grid = new QGridLayout(this, 2, 2, 10, -1, null); + TQGridLayout grid = new TQGridLayout(this, 2, 2, 10, -1, null); grid.addWidget(quit, 0, 0); grid.addWidget(box, 1, 1); grid.setColStretch(1, 10); - QVBoxLayout leftBox = new QVBoxLayout(); + TQVBoxLayout leftBox = new TQVBoxLayout(); grid.addLayout(leftBox, 1, 0); leftBox.addWidget(angle); leftBox.addWidget(force); - QHBoxLayout topBox = new QHBoxLayout(); + TQHBoxLayout topBox = new TQHBoxLayout(); grid.addLayout(topBox, 0, 1); topBox.addWidget(shoot); topBox.addWidget(hits); |