From 397b7afa8e3f32268c4454bf4783ac2a5a799658 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 15 Oct 2024 13:05:33 +0900 Subject: Rename ntqapplication, ntqconfig and ntqmodules files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/designer-manual-6.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/html/designer-manual-6.html') diff --git a/doc/html/designer-manual-6.html b/doc/html/designer-manual-6.html index ee8677c36..2ab181dcb 100644 --- a/doc/html/designer-manual-6.html +++ b/doc/html/designer-manual-6.html @@ -79,7 +79,7 @@ FORMS = settingsformbase.ui
Creating the Test Harness

Although we intend our dialog to be used within an application it is useful to create a test harness so that we can develop and test it stand-alone. Click File|New to invoke the 'New File' dialog, then click 'C++ Source', then click OK. In the editor window that pops up, enter the following code:

-#include <ntqapplication.h>
+#include <tqapplication.h>
 #include "creditformbase.h"
 
 int main( int argc, char *argv[] ) 
@@ -135,18 +135,18 @@ int main( int argc, char *argv[] )
 

We call setAmount() in the constructor to ensure that the correct amount is shown when the form starts based on whichever radio button we checked in TQt Designer. In setAmount() we set the amount if the standard or none radio button is checked. If the user has checked the special radio button they are free to change the amount themselves.

To be able to test our subclass we change main.cpp to include creditform.h rather than creditformbase.h and change the instantiation of the creditForm object:

-
    #include <ntqapplication.h>
+
    #include <tqapplication.h>
     #include "creditform.h"
 
     int main( int argc, char *argv[] )
     {
-        TQApplication app( argc, argv );
+        TQApplication app( argc, argv );
 
         CreditForm creditForm;
-        app.setMainWidget( &creditForm );
+        app.setMainWidget( &creditForm );
         creditForm.show();
 
-        return app.exec();
+        return app.exec();
     }
 

If you created the creditform.h and creditform.cpp files in TQt Designer, they are already in the project file, but if you created them manually you must also update the project file by adding these two new lines at the end:

@@ -176,18 +176,18 @@ INCLUDEPATH += $(TQTDIR)/tools/designer/uilib

We do not include the creditformbase.ui file since this file will be read at runtime, as we'll see shortly. We must include the tqui library since the functionality we require is not part of the standard TQt library.

Creating main.cpp

The main.cpp is quite standard. It will invoke the form we're going to create in TQt Designer as its main form. This form will then load and execute the dynamic dialog.

-
    #include <ntqapplication.h>
+
    #include <tqapplication.h>
     #include "mainform.h"
 
     int main( int argc, char *argv[] )
     {
-        TQApplication app( argc, argv );
+        TQApplication app( argc, argv );
 
         MainForm *mainForm = new MainForm;
-        app.setMainWidget( mainForm );
+        app.setMainWidget( mainForm );
         mainForm->show();
 
-        return app.exec();
+        return app.exec();
     }
 

We create a new instance of our MainForm class, set it to be the main widget, show it and enter the event loop in the app.exec() call.

-- cgit v1.2.1