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-03.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/html/tutorial1-03.html') diff --git a/doc/html/tutorial1-03.html b/doc/html/tutorial1-03.html index 9b04261cd..139746c3f 100644 --- a/doc/html/tutorial1-03.html +++ b/doc/html/tutorial1-03.html @@ -51,15 +51,15 @@ int main( int argc, char **argv ) TQApplication a( argc, argv ); TQVBox box; - box.resize( 200, 120 ); + box.resize( 200, 120 ); TQPushButton quit( "Quit", &box ); - quit.setFont( TQFont( "Times", 18, TQFont::Bold ) ); + quit.setFont( TQFont( "Times", 18, TQFont::Bold ) ); TQObject::connect( &quit, TQ_SIGNAL(clicked()), &a, TQ_SLOT(quit()) ); a.setMainWidget( &box ); - box.show(); + box.show(); return a.exec(); } @@ -76,8 +76,8 @@ int main( int argc, char **argv )

Here we simply create a vertical box container. The TQVBox arranges its child widgets in a vertical row, one above the other, handing out -space according to each child's TQWidget::sizePolicy(). -

        box.resize( 200, 120 );
+space according to each child's TQWidget::sizePolicy().
+

        box.resize( 200, 120 );
 

We set its width to 200 pixels and the height to 120 pixels.

        TQPushButton quit( "Quit", &box );
@@ -89,16 +89,16 @@ displayed, it is clipped by its parent's bounds.
 

The parent widget, the TQVBox, automatically adds the child centered in its box. Because nothing else is added, the button gets all the space the parent has. -

        box.show();
+

        box.show();
 

When a parent widget is shown, it will call show for all its children -(except those on which you have done an explicit TQWidget::hide()). +(except those on which you have done an explicit TQWidget::hide()).

Behavior

The button no longer fills the entire widget. Instead, it gets a "natural" size. This is because there is now a new top-level widget, which uses the button's size hint and size change policy to set the -button's size and position. (See TQWidget::sizeHint() and TQWidget::setSizePolicy() for more information about these functions.) +button's size and position. (See TQWidget::sizeHint() and TQWidget::setSizePolicy() for more information about these functions.)

(See Compiling for how to create a makefile and build the application.)

Exercises -- cgit v1.2.3