From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- doc/html/tutorial2-04.html | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 doc/html/tutorial2-04.html (limited to 'doc/html/tutorial2-04.html') diff --git a/doc/html/tutorial2-04.html b/doc/html/tutorial2-04.html new file mode 100644 index 0000000..d697a4f --- /dev/null +++ b/doc/html/tutorial2-04.html @@ -0,0 +1,79 @@ + + + + + +Mainly Easy + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

Mainly Easy

+ + +

+

(main.cpp.) +

+ +

    #include <qapplication.h>
+    #include "chartform.h"
+
+    int main( int argc, char *argv[] )
+    {
+        QApplication app( argc, argv );
+
+        QString filename;
+        if ( app.argc() > 1 ) {
+            filename = app.argv()[1];
+            if ( !filename.endsWith( ".cht" ) )
+                filename = QString::null;
+        }
+
+        ChartForm *cf = new ChartForm( filename );
+        app.setMainWidget( cf );
+        cf->show();
+
+        return app.exec();
+    }
+
+

We have kept the main() function simple and small. We create a +QApplication object and pass it the command line arguments. We are +allowing users to invoke the program with chart mychart.cht, so if +they've added a filename we pass that through to the chart form +constructor. Most of the action takes place within the chart form +which we'll review next. +

+« Data Elements | +Contents | +Presenting the GUI » +

+

+ +


+ +
Copyright © 2007 +TrolltechTrademarks +
Qt 3.3.8
+
+ -- cgit v1.2.1