File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,14 @@ using namespace std;
30
30
*/
31
31
int main (int argc, char *argv[])
32
32
{
33
- QApplication app (argc, argv);// starts the application
34
- // there should probably be some code that calls Main_crava(0,true,fileName) if a an argument is an exisiting xml file.
35
- QPointer<Main_crava> crava=new Main_crava;// creates the application main window
33
+ QApplication app (argc, argv);// starts the application, argc is QString, argv is QList
34
+ QPointer<Main_crava> crava;// declare pointer to the main window
35
+ if (argc==2 ){// har filename been provided on command line?
36
+ crava=new Main_crava (0 ,true ,argv[1 ]);// creates the application main window with file from commandline
37
+ }
38
+ else {
39
+ crava=new Main_crava;// creates application window with no command line parameters
40
+ }
36
41
crava->show ();// shows it.
37
42
return app.exec ();// pass control
38
43
}
You can’t perform that action at this time.
0 commit comments