Changeset 874 for trunk/source/interfaces/common/src
- Timestamp:
- Oct 30, 2008, 5:48:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/interfaces/common/src/G4Qt.cc
r867 r874 25 25 // 26 26 // 27 // $Id: G4Qt.cc,v 1. 9 2008/10/15 09:09:47lgarnier Exp $27 // $Id: G4Qt.cc,v 1.10 2008/10/24 13:23:22 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 56 56 /***************************************************************************/ 57 57 G4Qt* G4Qt::getInstance ( 58 int *a_argn58 int a_argn 59 59 ,char** a_args 60 60 ,char* a_class … … 70 70 /***************************************************************************/ 71 71 G4Qt::G4Qt ( 72 int *a_argn72 int a_argn 73 73 ,char** a_args 74 74 ,char* a_class … … 77 77 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 78 78 { 79 #ifdef G EANT4_QT_DEBUG79 #ifdef G4DEBUG 80 80 printf("G4Qt::G4Qt try to inited Qt\n"); 81 81 #endif … … 88 88 SetMainInteractor (qApp); 89 89 //#endif 90 SetArguments (*a_argn,a_args); 91 #ifdef GEANT4_QT_DEBUG 90 SetArguments (a_argn,a_args); 91 92 #ifdef G4DEBUG 92 93 printf("G4Qt::G4Qt alredy inited in external \n"); 93 94 #endif … … 95 96 96 97 if(QtInited==FALSE) { //Qt should be Inited once ! 97 #ifdef GEANT4_QT_DEBUG 98 printf("G4Qt::G4Qt inited Qt\n"); 99 #endif 98 // Then two cases : 99 // - It is the first time we create G4UI (argc!=0) 100 // -> Inited and register 101 // - It is the first time we create G4VIS (arc == 0) 102 // -> Inited and NOT register 103 104 int argc; 105 char ** test; 106 if (a_argn != 0) { 107 SetArguments (a_argn,a_args); 108 #ifdef G4DEBUG 109 printf("G4Qt::G4Qt inited, first time creating UI \n"); 110 #endif 111 } else { //argc = 0 112 test = GetArguments(&argc); 113 114 #ifdef G4DEBUG 115 116 printf("G4Qt::G4Qt inited, create new QtVis\n"); 117 printf("G4Qt::G4Qt arguments avant %s\n",a_args[0]); 118 printf("G4Qt::G4Qt arguments avant %s\n",a_args[1]); 119 printf("G4Qt::G4Qt arguments avant %s\n",a_args[2]); 120 printf("G4Qt::G4Qt arguments avant %s\n",a_args[3]); 121 printf("G4Qt::G4Qt arguments apres %d\n",argc); 122 printf("G4Qt::G4Qt arguments apres %s \n",test[0]); 123 printf("G4Qt::G4Qt arguments apres %s \n",test[1]); 124 printf("G4Qt::G4Qt arguments apres %s \n",test[2]); 125 printf("G4Qt::G4Qt arguments apres %s \n",test[3]); 126 #endif 127 if (argc == 0) { 128 G4cout << "G4Qt : Unable to init Qt." << G4endl; 129 return; 130 } 131 } 100 132 #if QT_VERSION < 0x040000 101 qApp = new QApplication ( *a_argn, a_args);133 qApp = new QApplication (a_argn, a_args); 102 134 // QApplication qApp(a_argn, a_args); 103 135 // if(&qApp == NULL) { 104 136 #else 105 new QApplication (*a_argn, a_args); 106 #endif 137 new QApplication (a_argn, a_args); 138 #endif 139 107 140 if(!qApp) { 108 141 109 142 G4cout << "G4Qt : Unable to init Qt." << G4endl; 110 143 } else { 144 if (a_argn != 0) { 145 SetMainInteractor (qApp); 146 SetArguments (a_argn,a_args); 147 } 111 148 QtInited = TRUE; 112 //#if QT_VERSION < 0x040000 113 // SetMainInteractor (&qApp); 114 //#else 115 SetMainInteractor (qApp); 116 //#endif 117 SetArguments (*a_argn,a_args); 118 #ifdef GEANT4_QT_DEBUG 149 #ifdef G4DEBUG 119 150 printf("G4Qt::G4Qt inited Qt END\n"); 120 151 #endif … … 122 153 } 123 154 } 124 #ifdef G EANT4_QT_DEBUG155 #ifdef G4DEBUG 125 156 if (qApp) { 126 157 printf("G4Qt::qApp exist\n");
Note: See TracChangeset
for help on using the changeset viewer.