Changed the order of application initialization to avoid window popping up with -h option
authorDmitriy Morozov <morozov@cs.duke.edu>
Tue, 22 Jul 2008 10:03:44 -0400
changeset 15 846354ed6853
parent 14 172c2683c714
child 16 bff3d7c294ff
Changed the order of application initialization to avoid window popping up with -h option
main.cpp
--- a/main.cpp	Tue Jul 22 10:01:49 2008 -0400
+++ b/main.cpp	Tue Jul 22 10:03:44 2008 -0400
@@ -15,10 +15,6 @@
 
 int main(int argc, char** argv)
 {
-    QApplication application(argc,argv);
-    ViewerInterface vi;
-    vi.show();
-
     // Parse program options
     std::vector<std::string> input_filenames;
     po::options_description hidden("Hidden options");
@@ -46,6 +42,11 @@
         return 1; 
     }
     
+    // Start the application
+    QApplication application(argc,argv);
+    ViewerInterface vi;
+    vi.show();
+
     for (std::vector<std::string>::const_iterator cur = input_filenames.begin();
                                                   cur != input_filenames.end(); ++cur)
         vi.viewer->addFile(cur->c_str());