diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:43:08 +0900 |
| commit | 35ced32e331ee29fda1642616c803637952f5b22 (patch) | |
| tree | da44726777f814e19c7ef1e43854f6a1693dd6fb /tutorial | |
| parent | 7dd4848d61e4c52091d6c644356c84c67536bde2 (diff) | |
| download | tqt-35ced32e.tar.gz tqt-35ced32e.zip | |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'tutorial')
| -rw-r--r-- | tutorial/t10/cannon.cpp | 2 | ||||
| -rw-r--r-- | tutorial/t11/cannon.cpp | 2 | ||||
| -rw-r--r-- | tutorial/t12/cannon.cpp | 6 | ||||
| -rw-r--r-- | tutorial/t13/cannon.cpp | 20 | ||||
| -rw-r--r-- | tutorial/t14/cannon.cpp | 26 | ||||
| -rw-r--r-- | tutorial/t15/main.cpp | 2 |
6 files changed, 29 insertions, 29 deletions
diff --git a/tutorial/t10/cannon.cpp b/tutorial/t10/cannon.cpp index b7525e681..803e05f56 100644 --- a/tutorial/t10/cannon.cpp +++ b/tutorial/t10/cannon.cpp @@ -27,7 +27,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } diff --git a/tutorial/t11/cannon.cpp b/tutorial/t11/cannon.cpp index a61b2bb68..637a0add0 100644 --- a/tutorial/t11/cannon.cpp +++ b/tutorial/t11/cannon.cpp @@ -36,7 +36,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } diff --git a/tutorial/t12/cannon.cpp b/tutorial/t12/cannon.cpp index f3d05ca12..5433be7cd 100644 --- a/tutorial/t12/cannon.cpp +++ b/tutorial/t12/cannon.cpp @@ -40,7 +40,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } @@ -69,9 +69,9 @@ void CannonField::shoot() void CannonField::newTarget() { - static bool first_time = TRUE; + static bool first_time = true; if ( first_time ) { - first_time = FALSE; + first_time = false; TQTime midnight( 0, 0, 0 ); srand( midnight.secsTo(TQTime::currentTime()) ); } diff --git a/tutorial/t13/cannon.cpp b/tutorial/t13/cannon.cpp index 9ca28f165..0b4902b74 100644 --- a/tutorial/t13/cannon.cpp +++ b/tutorial/t13/cannon.cpp @@ -26,7 +26,7 @@ CannonField::CannonField( TQWidget *parent, const char *name ) shoot_ang = 0; shoot_f = 0; target = TQPoint( 0, 0 ); - gameEnded = FALSE; + gameEnded = false; setPalette( TQPalette( TQColor( 250, 250, 200) ) ); newTarget(); } @@ -41,7 +41,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } @@ -65,15 +65,15 @@ void CannonField::shoot() shoot_ang = ang; shoot_f = f; autoShootTimer->start( 50 ); - emit canShoot( FALSE ); + emit canShoot( false ); } void CannonField::newTarget() { - static bool first_time = TRUE; + static bool first_time = true; if ( first_time ) { - first_time = FALSE; + first_time = false; TQTime midnight( 0, 0, 0 ); srand( midnight.secsTo(TQTime::currentTime()) ); } @@ -89,7 +89,7 @@ void CannonField::setGameOver() return; if ( isShooting() ) autoShootTimer->stop(); - gameEnded = TRUE; + gameEnded = true; repaint(); } @@ -97,9 +97,9 @@ void CannonField::restartGame() { if ( isShooting() ) autoShootTimer->stop(); - gameEnded = FALSE; + gameEnded = false; repaint(); - emit canShoot( TRUE ); + emit canShoot( true ); } void CannonField::moveShot() @@ -112,11 +112,11 @@ void CannonField::moveShot() if ( shotR.intersects( targetRect() ) ) { autoShootTimer->stop(); emit hit(); - emit canShoot( TRUE ); + emit canShoot( true ); } else if ( shotR.x() > width() || shotR.y() > height() ) { autoShootTimer->stop(); emit missed(); - emit canShoot( TRUE ); + emit canShoot( true ); } else { r = r.unite( TQRegion( shotR ) ); } diff --git a/tutorial/t14/cannon.cpp b/tutorial/t14/cannon.cpp index 1feacd9b4..d28401187 100644 --- a/tutorial/t14/cannon.cpp +++ b/tutorial/t14/cannon.cpp @@ -26,8 +26,8 @@ CannonField::CannonField( TQWidget *parent, const char *name ) shoot_ang = 0; shoot_f = 0; target = TQPoint( 0, 0 ); - gameEnded = FALSE; - barrelPressed = FALSE; + gameEnded = false; + barrelPressed = false; setPalette( TQPalette( TQColor( 250, 250, 200) ) ); newTarget(); } @@ -42,7 +42,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } @@ -66,15 +66,15 @@ void CannonField::shoot() shoot_ang = ang; shoot_f = f; autoShootTimer->start( 50 ); - emit canShoot( FALSE ); + emit canShoot( false ); } void CannonField::newTarget() { - static bool first_time = TRUE; + static bool first_time = true; if ( first_time ) { - first_time = FALSE; + first_time = false; TQTime midnight( 0, 0, 0 ); srand( midnight.secsTo(TQTime::currentTime()) ); } @@ -90,7 +90,7 @@ void CannonField::setGameOver() return; if ( isShooting() ) autoShootTimer->stop(); - gameEnded = TRUE; + gameEnded = true; repaint(); } @@ -98,9 +98,9 @@ void CannonField::restartGame() { if ( isShooting() ) autoShootTimer->stop(); - gameEnded = FALSE; + gameEnded = false; repaint(); - emit canShoot( TRUE ); + emit canShoot( true ); } void CannonField::moveShot() @@ -113,12 +113,12 @@ void CannonField::moveShot() if ( shotR.intersects( targetRect() ) ) { autoShootTimer->stop(); emit hit(); - emit canShoot( TRUE ); + emit canShoot( true ); } else if ( shotR.x() > width() || shotR.y() > height() || shotR.intersects(barrierRect()) ) { autoShootTimer->stop(); emit missed(); - emit canShoot( TRUE ); + emit canShoot( true ); } else { r = r.unite( TQRegion( shotR ) ); } @@ -132,7 +132,7 @@ void CannonField::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; if ( barrelHit( e->pos() ) ) - barrelPressed = TRUE; + barrelPressed = true; } @@ -153,7 +153,7 @@ void CannonField::mouseMoveEvent( TQMouseEvent *e ) void CannonField::mouseReleaseEvent( TQMouseEvent *e ) { if ( e->button() == LeftButton ) - barrelPressed = FALSE; + barrelPressed = false; } diff --git a/tutorial/t15/main.cpp b/tutorial/t15/main.cpp index 6fcbc1e72..bdf34686a 100644 --- a/tutorial/t15/main.cpp +++ b/tutorial/t15/main.cpp @@ -24,7 +24,7 @@ void WorkerObject::run() TQTimer *t = new TQTimer(this); connect( t, TQ_SIGNAL(timeout()), TQ_SLOT(timerHandler()) ); - t->start( 1000, FALSE ); + t->start( 1000, false ); for( int count = 0; count < 5; count++ ) { sleep( 1 ); |
