From 8ac0e970e4464d9f8f73c0fb34a178ff135be8c3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 2 Jun 2024 23:07:22 +0900 Subject: Rename ntqwidget* related files to equivalent tqwidget* Signed-off-by: Michele Calgaro --- doc/html/tutorial1-11.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/html/tutorial1-11.html') diff --git a/doc/html/tutorial1-11.html b/doc/html/tutorial1-11.html index 5538dde55..e4e977a6e 100644 --- a/doc/html/tutorial1-11.html +++ b/doc/html/tutorial1-11.html @@ -85,8 +85,8 @@ when the shot was fired.

    #include <math.h>
 

We include the math library because we need the sin() and cos() functions. -

    CannonField::CannonField( TQWidget *parent, const char *name )
-            : TQWidget( parent, name )
+

    CannonField::CannonField( TQWidget *parent, const char *name )
+            : TQWidget( parent, name )
     {
         ang = 45;
         f = 0;
@@ -96,7 +96,7 @@ when the shot was fired.
                  this, TQ_SLOT(moveShot()) );
         shoot_ang = 0;
         shoot_f = 0;
-        setPalette( TQPalette( TQColor( 250, 250, 200) ) );
+        setPalette( TQPalette( TQColor( 250, 250, 200) ) );
     }
 

We initialize our new private variables and connect the TQTimer::timeout() signal to our moveShot() slot. We'll move the @@ -125,7 +125,7 @@ cannon angle and force. Finally, we start the timer. autoShootTimer->stop(); else r = r.unite( TQRegion( shotR ) ); - repaint( r ); + repaint( r ); }

moveShot() is the slot that moves the shot, called every 50 @@ -143,7 +143,7 @@ shot one step along its trajectory. stop the timer or we add the new shotRect() to the TQRegion.

Finally, we repaint the TQRegion. This will send a single paint event for just the one or two rectangles that need updating. -

    void CannonField::paintEvent( TQPaintEvent *e )
+

    void CannonField::paintEvent( TQPaintEvent *e )
     {
         TQRect updateR = e->rect();
         TQPainter p( this );
@@ -208,15 +208,15 @@ integer.
 
 

-

    class MyWidget: public TQWidget
+

    class MyWidget: public TQWidget
     {
     public:
-        MyWidget( TQWidget *parent=0, const char *name=0 );
+        MyWidget( TQWidget *parent=0, const char *name=0 );
     };
 

The only addition is the Shoot button.

        TQPushButton *shoot = new TQPushButton( "&Shoot", this, "shoot" );
-        shoot->setFont( TQFont( "Times", 18, TQFont::Bold ) );
+        shoot->setFont( TQFont( "Times", 18, TQFont::Bold ) );
 

In the constructor we create and set up the Shoot button exactly like we did with the Quit button. Note that the first argument to the constructor -- cgit v1.2.3