Changeset 610 for trunk/geant4/interfaces/basic
- Timestamp:
- Nov 22, 2007, 6:07:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r608 r610 30 30 // L. Garnier 31 31 32 //#defineDEBUG32 #define GEANT4_QT_DEBUG 33 33 34 34 #ifdef G4UI_BUILD_QT_SESSION … … 128 128 #endif 129 129 130 // Set layouts 131 132 #if QT_VERSION < 0x040000 130 133 QSplitter *splitter = new QSplitter(Qt::Vertical); 131 fTextArea = new QTextEdit(fMainWindow); 132 QPushButton *clearButton = new QPushButton("clear",fMainWindow); 134 135 QWidget* topWidget = new QWidget(splitter); 136 QWidget* bottomWidget = new QWidget(splitter); 137 138 QVBoxLayout *layoutTop = new QVBoxLayout(topWidget); 139 QVBoxLayout *layoutBottom = new QVBoxLayout(bottomWidget); 140 #else 141 QWidget* topWidget = new QWidget(); 142 QWidget* bottomWidget = new QWidget(); 143 144 QVBoxLayout *layoutTop = new QVBoxLayout; 145 QVBoxLayout *layoutBottom = new QVBoxLayout; 146 #endif 147 148 // fill them 149 150 fTextArea = new QTextEdit(topWidget); 151 #ifdef GEANT4_QT_DEBUG 152 printf("G4UIQt:: end\n"); 153 #endif 154 #ifdef GEANT4_QT_DEBUG 155 printf("G4UIQt::PushButton 1\n"); 156 #endif 157 QPushButton *clearButton = new QPushButton("clear",topWidget); 158 #ifdef GEANT4_QT_DEBUG 159 printf("G4UIQt::end1\n"); 160 #endif 133 161 connect(clearButton, SIGNAL(clicked()), SLOT(ClearButtonCallback())); 134 162 135 163 #if QT_VERSION < 0x040000 136 fCommandHistoryArea = new QListView( );164 fCommandHistoryArea = new QListView(bottomWidget); 137 165 fCommandHistoryArea->setSelectionMode(QListView::Single); 138 166 connect(fCommandHistoryArea, SIGNAL(selectionChanged()), SLOT(CommandHistoryCallback())); … … 143 171 #endif 144 172 fCommandHistoryArea->installEventFilter(this); 145 fCommandLabel = new QLabel("", fMainWindow);146 147 fCommandArea = new QLineEdit( fMainWindow);173 fCommandLabel = new QLabel("",bottomWidget); 174 175 fCommandArea = new QLineEdit(bottomWidget); 148 176 fCommandArea->installEventFilter(this); 177 #ifdef GEANT4_QT_DEBUG 178 printf("G4UIQt:: 1\n"); 179 #endif 149 180 #if QT_VERSION < 0x040000 150 181 fCommandArea->setActiveWindow(); … … 163 194 164 195 165 // Set layouts 166 167 #if QT_VERSION < 0x040000 168 QWidget* topWidget = new QWidget(splitter); 169 QWidget* bottomWidget = new QWidget(splitter); 170 171 QVBoxLayout *layoutTop = new QVBoxLayout(topWidget); 172 QVBoxLayout *layoutBottom = new QVBoxLayout(bottomWidget); 173 #else 174 QWidget* topWidget = new QWidget(); 175 QWidget* bottomWidget = new QWidget(); 176 177 QVBoxLayout *layoutTop = new QVBoxLayout; 178 QVBoxLayout *layoutBottom = new QVBoxLayout; 179 #endif 180 196 #ifdef GEANT4_QT_DEBUG 197 printf("G4UIQt:: 2\n"); 198 #endif 199 200 #ifdef GEANT4_QT_DEBUG 201 printf("G4UIQt:: 3\n"); 202 #endif 181 203 182 204 … … 188 210 #endif 189 211 212 #ifdef GEANT4_QT_DEBUG 213 printf("G4UIQt:: 4\n"); 214 #endif 190 215 layoutBottom->addWidget(fCommandHistoryArea); 191 216 layoutBottom->addWidget(fCommandLabel); … … 199 224 200 225 226 #ifdef GEANT4_QT_DEBUG 227 printf("G4UIQt:: 5\n"); 228 #endif 201 229 fMainWindow->setCentralWidget(splitter); 202 230 … … 213 241 fMainWindow->menuBar()->insertItem( QString("&Help"), helpMenu ); 214 242 243 #ifdef GEANT4_QT_DEBUG 244 printf("G4UIQt:: 6\n"); 245 #endif 215 246 216 247 #else … … 223 254 QMenu *helpMenu = fMainWindow->menuBar()->addMenu("Help"); 224 255 helpMenu->addAction("Show Help", this, SLOT(ShowHelpCallback())); 256 #endif 257 #ifdef GEANT4_QT_DEBUG 258 printf("G4UIQt:: 7\n"); 225 259 #endif 226 260 … … 236 270 splitter->setSizes(vals); 237 271 } 272 #ifdef GEANT4_QT_DEBUG 273 printf("G4UIQt:: 8\n"); 274 #endif 238 275 239 276 if(UI!=NULL) UI->SetCoutDestination(this); // TO KEEP … … 282 319 #endif 283 320 interactorManager->DisableSecondaryLoop (); // TO KEEP 284 ((QApplication*)interactorManager->GetMainInteractor())->exec(); 321 if ((QApplication*)interactorManager->GetMainInteractor()) 322 ((QApplication*)interactorManager->GetMainInteractor())->exec(); 323 285 324 // on ne passe pas le dessous ? FIXME ???? 286 325 // je ne pense pas 13/06 … … 548 587 549 588 #if QT_VERSION < 0x040000 589 #ifdef GEANT4_QT_DEBUG 590 printf("G4UIQt::QTextEdit 1\n"); 591 #endif 550 592 fHelpArea = new QTextEdit(splitter); 551 #else 593 #ifdef GEANT4_QT_DEBUG 594 printf("G4UIQt::end 1\n"); 595 #endif 596 #else 597 #ifdef GEANT4_QT_DEBUG 598 printf("G4UIQt::QTextEdit 2\n"); 599 #endif 552 600 fHelpArea = new QTextEdit(); 601 #ifdef GEANT4_QT_DEBUG 602 printf("G4UIQt::end 2\n"); 603 #endif 553 604 #endif 554 605 fHelpArea->setReadOnly(true);
Note: See TracChangeset
for help on using the changeset viewer.