From 2cbcca0db1343e1c40e52af729a5eb34ca8a7e37 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 27 Jun 2024 21:53:17 +0900 Subject: Rename date and time nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/tutorial1-12.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/html/tutorial1-12.html') diff --git a/doc/html/tutorial1-12.html b/doc/html/tutorial1-12.html index 799a80b74..5f7ee92e8 100644 --- a/doc/html/tutorial1-12.html +++ b/doc/html/tutorial1-12.html @@ -171,9 +171,9 @@ hit the target).

-

    #include <ntqdatetime.h>
+

    #include <tqdatetime.h>
 
-

We include the TQDate, TQTime, and TQDateTime class definitions. +

We include the TQDate, TQTime, and TQDateTime class definitions.

    #include <stdlib.h>
 

We include the stdlib library because we need the rand() function. @@ -189,8 +189,8 @@ repaint() on a hidden widget. static bool first_time = TRUE; if ( first_time ) { first_time = FALSE; - TQTime midnight( 0, 0, 0 ); - srand( midnight.secsTo(TQTime::currentTime()) ); + TQTime midnight( 0, 0, 0 ); + srand( midnight.secsTo(TQTime::currentTime()) ); } TQRegion r( targetRect() ); target = TQPoint( 200 + rand() % 190, @@ -211,10 +211,10 @@ passed since midnight as a pseudo-random value. this one is guaranteed to keep its value between calls to the function.

The if test will succeed only the first time this function is called because we set first_time to FALSE inside the if block. -

Then we create the TQTime object midnight, which represents the time +

Then we create the TQTime object midnight, which represents the time 00:00:00. Next we fetch the number of seconds from midnight until -now and use it as a random seed. See the documentation for TQDate, -TQTime, and TQDateTime for more information. +now and use it as a random seed. See the documentation for TQDate, +TQTime, and TQDateTime for more information.

Finally we calculate the target's center point. We keep it within the rectangle (x=200, y=35, width=190, height=255), (i.e., the possible x and y values are x = 200..389 and y = 35..289) in a @@ -232,7 +232,7 @@ the left edge and with x values increasing to the right.

This part of the timer event has not changed from the previous chapter.

        if ( shotR.intersects( targetRect() ) ) {
-            autoShootTimer->stop();
+            autoShootTimer->stop();
             emit hit();
 

This if statement checks whether the shot rectangle intersects the @@ -243,7 +243,7 @@ world that a target was destroyed, and return. CannonField is a component we leave such decisions to the user of the component.

        } else if ( shotR.x() > width() || shotR.y() > height() ) {
-            autoShootTimer->stop();
+            autoShootTimer->stop();
             emit missed();
 

This if statement is the same as in the previous chapter, except that -- cgit v1.2.3