Changeset 626
- Timestamp:
- Nov 29, 2007, 7:22:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r624 r626 171 171 bool found = false; 172 172 #if QT_VERSION < 0x040000 173 // QWidgetList *list = QApplication::allWidgets(); 174 // QWidgetListIt it( *list ); // iterate over the widgets 175 // QWidget * widget; 176 // while ( (widget=it.current()) != 0 ) { // for each widget... 177 // ++it; 178 // if ((found== false) && (widget->inherits("QMainWindow"))) { 179 GLWindow = new QDialog(0,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 180 // found = true; 181 // } 182 // } 183 // delete list; // delete the list, not the widgets 184 #else 185 // foreach (QWidget *widget, QApplication::allWidgets()) { 186 // if ((found== false) && (widget->inherits("QMainWindow"))) { 187 GLWindow = new QDialog(0,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); 188 // found = true; 189 // } 190 // } 173 // theses lines does nothing exept this one "GLWindow = new QDialog(0.." 174 // but if I comment them, it doesn't work... 175 QWidgetList *list = QApplication::allWidgets(); 176 QWidgetListIt it( *list ); // iterate over the widgets 177 QWidget * widget; 178 while ( (widget=it.current()) != 0 ) { // for each widget... 179 ++it; 180 if ((found== false) && (widget->inherits("QMainWindow"))) { 181 GLWindow = new QDialog(0,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 182 found = true; 183 } 184 } 185 delete list; // delete the list, not the widgets 186 #else 187 foreach (QWidget *widget, QApplication::allWidgets()) { 188 if ((found== false) && (widget->inherits("QMainWindow"))) { 189 GLWindow = new QDialog(widget,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); 190 found = true; 191 } 192 } 191 193 #endif 192 194
Note: See TracChangeset
for help on using the changeset viewer.