Changeset 858 for trunk/source/interfaces/basic/src
- Timestamp:
- Oct 2, 2008, 10:29:48 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/interfaces/basic/src/G4UIQt.cc
r850 r858 30 30 // L. Garnier 31 31 32 // define GEANT4_QT_DEBUG32 //#define GEANT4_QT_DEBUG 33 33 34 34 #ifdef G4UI_BUILD_QT_SESSION … … 113 113 if(UI!=NULL) UI->SetSession(this); 114 114 115 // Check if already define in external app QMainWindow 116 bool found = false; 117 #if QT_VERSION < 0x040000 118 // theses lines does nothing exept this one "GLWindow = new QDialog(0..." 119 // but if I comment them, it doesn't work... 120 QWidgetList *list = QApplication::allWidgets(); 121 QWidgetListIt it( *list ); // iterate over the widgets 122 QWidget * widget; 123 while ( (widget=it.current()) != 0 ) { // for each widget... 124 ++it; 125 if ((found== false) && (widget->inherits("QMainWindow"))) { 126 found = true; 127 } 128 } 129 delete list; // delete the list, not the widgets 130 #else 131 foreach (QWidget *widget, QApplication::allWidgets()) { 132 if ((found== false) && (widget->inherits("QMainWindow"))) { 133 found = true; 134 } 135 } 136 #endif 137 138 if (found) { 139 G4cout << "G4UIQt : Found an external App with a QMainWindow already defined. Aborted" << G4endl; 140 return ; 141 } 115 142 fMainWindow = new QMainWindow(); 116 143
Note: See TracChangeset
for help on using the changeset viewer.