From 82ecd83484c9fa1ede059986ab771e74e33e68ef Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 16 Aug 2024 19:11:00 +0900 Subject: Rename layout nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/tutorial1-13.html | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'doc/html/tutorial1-13.html') diff --git a/doc/html/tutorial1-13.html b/doc/html/tutorial1-13.html index 5edbc4229..46ad23007 100644 --- a/doc/html/tutorial1-13.html +++ b/doc/html/tutorial1-13.html @@ -66,17 +66,17 @@ implementation. class LCDRange : public TQWidget -

We inherit TQWidget rather than TQVBox. TQVBox is very easy to use, but +

We inherit TQWidget rather than TQVBox. TQVBox is very easy to use, but again it showed its limitations so we switch to the more powerful and -slightly harder to use TQVBoxLayout. (As you remember, TQVBoxLayout is +slightly harder to use TQVBoxLayout. (As you remember, TQVBoxLayout is not a widget, it manages one.)

t13/lcdrange.cpp

-

    #include <ntqlayout.h>
+

    #include <tqlayout.h>
 
-

We need to include ntqlayout.h now to get the other layout management +

We need to include tqlayout.h now to get the other layout management API.

    LCDRange::LCDRange( TQWidget *parent, const char *name )
             : TQWidget( parent, name )
@@ -84,19 +84,19 @@ API.
 

We inherit TQWidget in the usual way.

The other constructor has the same change. init() is unchanged, except that we've added some lines at the end: -

        TQVBoxLayout * l = new TQVBoxLayout( this );
+

        TQVBoxLayout * l = new TQVBoxLayout( this );
 

We create a TQVBoxLayout with all the default values, managing this widget's children. -

        l->addWidget( lcd, 1 );
+

        l->addWidget( lcd, 1 );
 

At the top we add the TQLCDNumber with a non-zero stretch. -

        l->addWidget( slider );
-        l->addWidget( label );
+

        l->addWidget( slider );
+        l->addWidget( label );
 

Then we add the other two, both with the default zero stretch. -

This stretch control is something TQVBoxLayout (and TQHBoxLayout, and -TQGridLayout) offers but classes like TQVBox do not. In this case +

This stretch control is something TQVBoxLayout (and TQHBoxLayout, and +TQGridLayout) offers but classes like TQVBox do not. In this case we're saying that the TQLCDNumber should stretch and the others should not.

t13/cannon.h @@ -297,15 +297,15 @@ pointers to the TQLabel widgets in the GameBoard clas nothing much we want to do with them. TQt will delete them when the GameBoard widget is destroyed, and the layout classes will resize them appropriately. -

        TQHBoxLayout *topBox = new TQHBoxLayout;
+

        TQHBoxLayout *topBox = new TQHBoxLayout;
         grid->addLayout( topBox, 0, 1 );
-        topBox->addWidget( shoot );
-        topBox->addWidget( hits );
-        topBox->addWidget( hitsL );
-        topBox->addWidget( shotsLeft );
-        topBox->addWidget( shotsLeftL );
-        topBox->addStretch( 1 );
-        topBox->addWidget( restart );
+        topBox->addWidget( shoot );
+        topBox->addWidget( hits );
+        topBox->addWidget( hitsL );
+        topBox->addWidget( shotsLeft );
+        topBox->addWidget( shotsLeftL );
+        topBox->addStretch( 1 );
+        topBox->addWidget( restart );
 

The number of widgets in the top-right cell is getting large. Once it was empty; now it's full enough that we group together the layout -- cgit v1.2.3