Changeset 608 for trunk/geant4/interfaces/basic/src
- Timestamp:
- Nov 15, 2007, 7:41:15 PM (17 years ago)
- Location:
- trunk/geant4/interfaces/basic/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r607 r608 25 25 // 26 26 // 27 // $Id: G4UIQt.cc,v 1. 9 2007/11/15 10:10:02lgarnier Exp $27 // $Id: G4UIQt.cc,v 1.12 2007/11/15 18:24:27 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 60 60 #include <qsignalmapper.h> 61 61 62 #include <qmainwindow.h> 62 63 #if QT_VERSION >= 0x040000 63 64 #include <qmenu.h> 64 65 #include <qlistwidget.h> 65 66 #include <qtreewidget.h> 66 #include <qmainwindow.h>67 67 #else 68 68 #include <qaction.h> … … 106 106 :fHelpDialog(NULL) 107 107 { 108 #ifdef GEANT4_QT_DEBUG 108 109 printf("G4UIQt::Initialise %d %s\n",argc,argv[0]); 110 #endif 109 111 G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt"); 110 112 G4UImanager* UI = G4UImanager::GetUIpointer(); … … 113 115 fMainWindow = new QMainWindow(); 114 116 117 #ifdef GEANT4_QT_DEBUG 115 118 printf("G4UIQt::Initialise after main window creation\n"); 119 #endif 116 120 #if QT_VERSION < 0x040000 117 121 fMainWindow->setCaption( tr( "G4UI Session" )); … … 132 136 fCommandHistoryArea = new QListView(); 133 137 fCommandHistoryArea->setSelectionMode(QListView::Single); 138 connect(fCommandHistoryArea, SIGNAL(selectionChanged()), SLOT(CommandHistoryCallback())); 134 139 #else 135 140 fCommandHistoryArea = new QListWidget(); 136 141 fCommandHistoryArea->setSelectionMode(QAbstractItemView::SingleSelection); 137 #endif138 142 connect(fCommandHistoryArea, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback())); 143 #endif 139 144 fCommandHistoryArea->installEventFilter(this); 140 145 fCommandLabel = new QLabel("",fMainWindow); … … 200 205 // Add a quit subMenu 201 206 QPopupMenu *fileMenu = new QPopupMenu( fMainWindow); 202 fileMenu->insertItem( "&Quitter", this, SLOT( close()), CTRL+Key_Q );207 fileMenu->insertItem( "&Quitter", this, SLOT(ExitSession()), CTRL+Key_Q ); 203 208 fMainWindow->menuBar()->insertItem( QString("&File"), fileMenu ); 204 209 … … 213 218 // Add a quit subMenu 214 219 QMenu *fileMenu = fMainWindow->menuBar()->addMenu("File"); 215 fileMenu->addAction("Quitter", fMainWindow, SLOT(close()));220 fileMenu->addAction("Quitter", this, SLOT(ExitSession())); 216 221 217 222 // Add a Help menu … … 261 266 262 267 #if QT_VERSION >= 0x040000 268 #if QT_VERSION >= 0x040200 263 269 fMainWindow->setVisible(true); 270 #else 271 fMainWindow->show(); 272 #endif 264 273 #else 265 274 fMainWindow->show(); … … 269 278 270 279 280 #ifdef GEANT4_QT_DEBUG 271 281 printf("disable secondary loop\n"); 282 #endif 272 283 interactorManager->DisableSecondaryLoop (); // TO KEEP 273 284 ((QApplication*)interactorManager->GetMainInteractor())->exec(); … … 282 293 283 294 interactorManager->EnableSecondaryLoop (); 295 #ifdef GEANT4_QT_DEBUG 284 296 printf("enable secondary loop\n"); 297 #endif 285 298 return this; 286 299 } … … 326 339 if (!aState) return; 327 340 341 #ifdef GEANT4_QT_DEBUG 328 342 printf("G4UIQt::PauseSessionStart\n"); 343 #endif 329 344 if(aState=="G4_pause> ") { // TO KEEP 330 345 SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP … … 349 364 if (!aPrompt) return; 350 365 366 #ifdef GEANT4_QT_DEBUG 351 367 printf("G4UIQt::SecondaryLoop\n"); 368 #endif 352 369 G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ? 353 370 Prompt(aPrompt); // TO KEEP … … 376 393 if (!interactorManager) return 0; 377 394 378 // printf(" **************** G4 Cout : %s\n",(char*)aString.data());379 395 #if QT_VERSION < 0x040000 380 396 fTextArea->append(QString((char*)aString.data()).simplifyWhiteSpace()); … … 895 911 ) 896 912 { 913 #ifdef GEANT4_QT_DEBUG 897 914 printf("G4UIQt::GetHelpChoice SHOULD NEVER GO HERE"); 915 #endif 898 916 return true; 899 917 } … … 905 923 ) 906 924 { 925 #ifdef GEANT4_QT_DEBUG 907 926 printf("G4UIQt::ExitHelp SHOULD NEVER GO HERE"); 927 #endif 908 928 } 909 929 … … 1040 1060 } 1041 1061 1062 /** Called when user exit session 1063 */ 1064 void G4UIQt::ExitSession ( 1065 ) 1066 { 1067 SessionTerminate(); 1068 } 1069 1042 1070 1043 1071 /** Callback call when "click on a menu entry.<br> … … 1071 1099 TerminalHelp(command); 1072 1100 } 1101 #ifdef GEANT4_QT_DEBUG 1073 1102 printf("after \n"); 1103 #endif 1074 1104 if(exitSession==true) 1075 1105 SessionTerminate(); … … 1172 1202 ) 1173 1203 { 1204 #ifdef GEANT4_QT_DEBUG 1174 1205 printf("G4UIQt::HelpTreeDoubleClicCallback"); 1206 #endif 1175 1207 HelpTreeClicCallback(); 1176 1208 fCommandArea->setText(item->text (1)); -
trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc
r606 r608 3 3 ** 4 4 ** Created: Tue Nov 13 18:13:09 2007 5 ** by: The Qt MOC ($Id: G4UIQt_moc.cc,v 1. 6 2007/11/14 10:38:49lgarnier Exp $)5 ** by: The Qt MOC ($Id: G4UIQt_moc.cc,v 1.8 2007/11/15 18:24:28 lgarnier Exp $) 6 6 ** 7 7 ** WARNING! All changes made in this file will be lost! … … 19 19 #include <private/qucomextra_p.h> 20 20 #if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) 21 #error "This file was generated using the moc from 3.3. 5. It"21 #error "This file was generated using the moc from 3.3.8. It" 22 22 #error "cannot be used with the include files from this version of Qt." 23 23 #error "(The moc has changed too much.)" … … 57 57 return metaObj; 58 58 QMetaObject* parentObject = QObject::staticMetaObject(); 59 static const QUMethod slot_0 = {"ClearButtonCallback", 0, 0 }; 60 static const QUMethod slot_1 = {"CommandEnteredCallback", 0, 0 }; 61 static const QUParameter param_slot_2[] = { 59 static const QUMethod slot_0 = {"ExitSession", 0, 0 }; 60 static const QUMethod slot_1 = {"ClearButtonCallback", 0, 0 }; 61 static const QUMethod slot_2 = {"CommandEnteredCallback", 0, 0 }; 62 static const QUParameter param_slot_3[] = { 62 63 { 0, &static_QUType_QString, 0, QUParameter::In } 63 64 }; 64 static const QUMethod slot_ 2 = {"ButtonCallback", 1, param_slot_2};65 static const QUMethod slot_ 3= {"HelpTreeClicCallback", 0, 0 };66 static const QUParameter param_slot_ 4[] = {67 { 0, &static_QUType_ptr, "Q TreeWidgetItem", QUParameter::In },65 static const QUMethod slot_3 = {"ButtonCallback", 1, param_slot_3 }; 66 static const QUMethod slot_4 = {"HelpTreeClicCallback", 0, 0 }; 67 static const QUParameter param_slot_5[] = { 68 { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In }, 68 69 { 0, &static_QUType_int, 0, QUParameter::In } 69 70 }; 70 static const QUMethod slot_ 4 = {"HelpTreeDoubleClicCallback", 2, param_slot_4};71 static const QUMethod slot_ 5= {"ShowHelpCallback", 0, 0 };72 static const QUMethod slot_ 6= {"CommandHistoryCallback", 0, 0 };71 static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 2, param_slot_5 }; 72 static const QUMethod slot_6 = {"ShowHelpCallback", 0, 0 }; 73 static const QUMethod slot_7 = {"CommandHistoryCallback", 0, 0 }; 73 74 static const QMetaData slot_tbl[] = { 74 { "ClearButtonCallback()", &slot_0, QMetaData::Private }, 75 { "CommandEnteredCallback()", &slot_1, QMetaData::Private }, 76 { "ButtonCallback(const QString&)", &slot_2, QMetaData::Private }, 77 { "HelpTreeClicCallback()", &slot_3, QMetaData::Private }, 78 { "HelpTreeDoubleClicCallback(QTreeWidgetItem*,int)", &slot_4, QMetaData::Private }, 79 { "ShowHelpCallback()", &slot_5, QMetaData::Private }, 80 { "CommandHistoryCallback()", &slot_6, QMetaData::Private } 75 { "ExitSession()", &slot_0, QMetaData::Private }, 76 { "ClearButtonCallback()", &slot_1, QMetaData::Private }, 77 { "CommandEnteredCallback()", &slot_2, QMetaData::Private }, 78 { "ButtonCallback(const QString&)", &slot_3, QMetaData::Private }, 79 { "HelpTreeClicCallback()", &slot_4, QMetaData::Private }, 80 { "HelpTreeDoubleClicCallback(QListViewItem*,int)", &slot_5, QMetaData::Private }, 81 { "ShowHelpCallback()", &slot_6, QMetaData::Private }, 82 { "CommandHistoryCallback()", &slot_7, QMetaData::Private } 81 83 }; 82 84 static const QUParameter param_signal_0[] = { … … 89 91 metaObj = QMetaObject::new_metaobject( 90 92 "G4UIQt", parentObject, 91 slot_tbl, 7,93 slot_tbl, 8, 92 94 signal_tbl, 1, 93 95 #ifndef QT_NO_PROPERTIES … … 120 122 { 121 123 switch ( _id - staticMetaObject()->slotOffset() ) { 122 case 0: ClearButtonCallback(); break; 123 case 1: CommandEnteredCallback(); break; 124 case 2: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break; 125 case 3: HelpTreeClicCallback(); break; 126 #if QT_VERSION < 0x040000 127 case 4: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break; 128 #else 129 case 4: HelpTreeDoubleClicCallback((QTreeWidgetItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break; 130 #endif 131 case 5: ShowHelpCallback(); break; 132 case 6: CommandHistoryCallback(); break; 124 case 0: ExitSession(); break; 125 case 1: ClearButtonCallback(); break; 126 case 2: CommandEnteredCallback(); break; 127 case 3: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break; 128 case 4: HelpTreeClicCallback(); break; 129 case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break; 130 case 6: ShowHelpCallback(); break; 131 case 7: CommandHistoryCallback(); break; 133 132 default: 134 133 return QObject::qt_invoke( _id, _o ); … … 155 154 bool G4UIQt::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } 156 155 #endif // QT_NO_PROPERTIES 156 157 157 158 158 #endif … … 188 188 0, // classname 189 189 0, 0, // classinfo 190 8, 10, // methods190 9, 10, // methods 191 191 0, 0, // properties 192 192 0, 0, // enums/sets … … 197 197 // slots: signature, parameters, type, tag, flags 198 198 32, 31, 31, 31, 0x08, 199 54, 31, 31, 31, 0x08, 200 79, 31, 31, 31, 0x08, 201 103, 31, 31, 31, 0x08, 202 126, 175, 31, 31, 0x08, 203 177, 31, 31, 31, 0x08, 204 196, 31, 31, 31, 0x08, 199 46, 31, 31, 31, 0x08, 200 68, 31, 31, 31, 0x08, 201 93, 31, 31, 31, 0x08, 202 117, 31, 31, 31, 0x08, 203 140, 189, 31, 31, 0x08, 204 191, 31, 31, 31, 0x08, 205 210, 31, 31, 31, 0x08, 205 206 206 207 0 // eod … … 209 210 static const char qt_meta_stringdata_G4UIQt[] = { 210 211 "G4UIQt\0myClicked(QString)\0text\0\0" 211 "ClearButtonCallback()\0CommandEnteredCallback()\0" 212 "ExitSession()\0ClearButtonCallback()\0" 213 "CommandEnteredCallback()\0" 212 214 "ButtonCallback(QString)\0HelpTreeClicCallback()\0" 213 215 "HelpTreeDoubleClicCallback(QTreeWidgetItem*,int)\0" … … 245 247 switch (_id) { 246 248 case 0: myClicked((*reinterpret_cast< const QString(*)>(_a[1]))); break; 247 case 1: ClearButtonCallback(); break; 248 case 2: CommandEnteredCallback(); break; 249 case 3: ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break; 250 case 4: HelpTreeClicCallback(); break; 251 case 5: HelpTreeDoubleClicCallback((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; 252 case 6: ShowHelpCallback(); break; 253 case 7: CommandHistoryCallback(); break; 249 case 1: ExitSession(); break; 250 case 2: ClearButtonCallback(); break; 251 case 3: CommandEnteredCallback(); break; 252 case 4: ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break; 253 case 5: HelpTreeClicCallback(); break; 254 case 6: HelpTreeDoubleClicCallback((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; 255 case 7: ShowHelpCallback(); break; 256 case 8: CommandHistoryCallback(); break; 254 257 } 255 _id -= 8;258 _id -= 9; 256 259 } 257 260 return _id;
Note: See TracChangeset
for help on using the changeset viewer.