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-04.html | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'doc/html/tutorial1-04.html') diff --git a/doc/html/tutorial1-04.html b/doc/html/tutorial1-04.html index fc23a6f94..4e69e7500 100644 --- a/doc/html/tutorial1-04.html +++ b/doc/html/tutorial1-04.html @@ -46,22 +46,22 @@ minimum and maximum sizes of a widget, and introduces widget names. #include <ntqfont.h> -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 ); }; -MyWidget::MyWidget( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +MyWidget::MyWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - setMinimumSize( 200, 120 ); - setMaximumSize( 200, 120 ); + setMinimumSize( 200, 120 ); + setMaximumSize( 200, 120 ); TQPushButton *quit = new TQPushButton( "Quit", this, "quit" ); - quit->setGeometry( 62, 40, 75, 30 ); - quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); + quit->setGeometry( 62, 40, 75, 30 ); + quit->setFont( TQFont( "Times", 18, TQFont::Bold ) ); connect( quit, TQ_SIGNAL(clicked()), tqApp, TQ_SLOT(quit()) ); } @@ -72,9 +72,9 @@ int main( int argc, char **argv ) TQApplication a( argc, argv ); MyWidget w; - w.setGeometry( 100, 100, 200, 120 ); + w.setGeometry( 100, 100, 200, 120 ); a.setMainWidget( &w ); - w.show(); + w.show(); return a.exec(); } @@ -83,13 +83,13 @@ int main( int argc, char **argv )

Line-by-line Walkthrough

-

    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 );
     };
 
-

Here we create a new class. Because this class inherits from TQWidget, +

Here we create a new class. Because this class inherits from TQWidget, the new class is a widget and may be a top level window or a child widget (like the push button in Chapter 3).

This class has only one member, a constructor (in addition to the @@ -103,22 +103,22 @@ defaults to be a top-level window. that appears in the window's title bar or in the button. It is a name associated with a widget to make it possible to look up this widget later, and there is also a handy debugging function that will list a complete widget hierarchy. -

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

    MyWidget::MyWidget( TQWidget *parent, const char *name )
+            : TQWidget( parent, name )
 

The implementation of the constructor starts here. Like most widgets, -it just passes on the parent and name to the TQWidget +it just passes on the parent and name to the TQWidget constructor.

    {
-        setMinimumSize( 200, 120 );
-        setMaximumSize( 200, 120 );
+        setMinimumSize( 200, 120 );
+        setMaximumSize( 200, 120 );
 

Because this widget doesn't know how to handle resizing, we fix its size by setting the minimum and maximum to be equal. In the next chapter we will show how a widget can respond to resize event from the user.

        TQPushButton *quit = new TQPushButton( "Quit", this, "quit" );
-        quit->setGeometry( 62, 40, 75, 30 );
-        quit->setFont( TQFont( "Times", 18, TQFont::Bold ) );
+        quit->setGeometry( 62, 40, 75, 30 );
+        quit->setFont( TQFont( "Times", 18, TQFont::Bold ) );
 

Here we create and set up a child widget of this widget (the new widget's parent is this) which has the widget name "quit". The widget @@ -148,9 +148,9 @@ MyWidget needs to talk to the application object. TQApplication a( argc, argv ); MyWidget w; - w.setGeometry( 100, 100, 200, 120 ); + w.setGeometry( 100, 100, 200, 120 ); a.setMainWidget( &w ); - w.show(); + w.show(); return a.exec(); }

-- cgit v1.2.3