Changeset 617 for trunk/geant4/interfaces
- Timestamp:
- Nov 26, 2007, 6:10:35 PM (17 years ago)
- Location:
- trunk/geant4/interfaces
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r615 r617 109 109 printf("G4UIQt::Initialise %d %s\n",argc,argv[0]); 110 110 #endif 111 printf("G4UIQt::Initialise ******\n");112 111 G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt"); 113 112 G4UImanager* UI = G4UImanager::GetUIpointer(); … … 129 128 #endif 130 129 131 QSplitter *splitter = new QSplitter(Qt::Vertical );130 QSplitter *splitter = new QSplitter(Qt::Vertical,fMainWindow); 132 131 133 132 // Set layouts … … 488 487 ) 489 488 { 489 #ifdef GEANT4_QT_DEBUG 490 printf("G4UIQt::AddMenu 1\n"); 491 #endif 490 492 if (aName == NULL) return; 491 493 if (aLabel == NULL) return; 492 494 495 #ifdef GEANT4_QT_DEBUG 496 printf("G4UIQt::AddMenu 2 %s %s\n",aName,aLabel); 497 #endif 493 498 #if QT_VERSION < 0x040000 494 499 QPopupMenu *fileMenu = new QPopupMenu( fMainWindow); … … 529 534 QSignalMapper *signalMapper = new QSignalMapper(this); 530 535 #if QT_VERSION < 0x040000 536 #if QT_VERSION < 0x030200 537 QAction *action = new QAction(QString(aLabel),QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map())); 538 #else 531 539 QAction *action = new QAction(QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map())); 540 #endif 532 541 action->addTo(parent); 533 542 #else … … 556 565 #if QT_VERSION < 0x040000 557 566 fHelpDialog = new QDialog(fMainWindow,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 558 #else 567 QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog); 568 QWidget* global = new QWidget(fHelpDialog); 569 #else 570 QVBoxLayout *vLayout = new QVBoxLayout(); 559 571 fHelpDialog = new QDialog(fMainWindow,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); 560 572 #endif 561 QSplitter *splitter = new QSplitter(Qt::Horizontal); 573 QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog); 574 562 575 QPushButton *exitButton = new QPushButton("Exit",fMainWindow); 563 576 connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close())); … … 574 587 fHelpTreeWidget->addColumn("Command"); 575 588 fHelpTreeWidget->addColumn("Description"); 576 fHelpTreeWidget-> hideColumn(1);589 fHelpTreeWidget->setColumnWidth (1,0); 577 590 fHelpTreeWidget->header()->setResizeEnabled(FALSE,1); 578 591 // QList<QListViewItem *> items; … … 643 656 // Set layouts 644 657 645 #if QT_VERSION < 0x040000 646 QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog); 647 #else 648 QVBoxLayout *vLayout = new QVBoxLayout; 658 #if QT_VERSION >= 0x040000 649 659 splitter->addWidget(fHelpTreeWidget); 650 660 splitter->addWidget(fHelpArea); … … 652 662 653 663 664 #if QT_VERSION < 0x040000 665 vLayout->addWidget(global); 666 #else 654 667 vLayout->addWidget(splitter); 668 #endif 655 669 vLayout->addWidget(exitButton); 656 670 #if QT_VERSION >= 0x040000 … … 1186 1200 ) 1187 1201 { 1188 #ifdef GEANT4_QT_DEBUG 1189 printf("G4UIQt::HelpTreeClicCallback"); 1190 #endif 1202 // printf("G4UIQt::HelpTreeClicCallback"); 1191 1203 #if QT_VERSION < 0x040000 1192 1204 QListViewItem* item = NULL; … … 1254 1266 QTreeWidgetItem* item 1255 1267 #endif 1256 ,int nb1268 ,int 1257 1269 ) 1258 1270 { -
trunk/geant4/interfaces/common/src/G4Qt.cc
r615 r617 29 29 // 30 30 // L. Garnier 31 32 #define GEANT4_QT_DEBUG33 31 34 32 #if defined(G4INTY_BUILD_QT) || defined(G4INTY_USE_QT) … … 101 99 #endif 102 100 #if QT_VERSION < 0x040000 103 // EN TESTqApp = new QApplication (a_argn, a_args);101 qApp = new QApplication (a_argn, a_args); 104 102 // QApplication qApp(a_argn, a_args); 105 103 // if(&qApp == NULL) { … … 124 122 } 125 123 #ifdef GEANT4_QT_DEBUG 126 //if (qApp) {124 if (qApp) { 127 125 printf("G4Qt::qApp exist\n"); 128 // =================== EN TEST ============== 129 new QApplication ( a_argn, a_args ); 130 131 QPushButton hello( "Hello world!", 0 ); 132 hello.resize( 100, 30 ); 133 134 qApp->setMainWidget( &hello ); 135 hello.show(); 136 qApp->exec(); 137 printf("G4Qt::qApp exist END\n"); 138 // =================== EN TEST ============== 139 // } else { 140 // printf("G4Qt::qApp not exist\n"); 141 // } 126 } else { 127 printf("G4Qt::qApp not exist\n"); 128 } 142 129 #endif 143 130 // AddDispatcher ((G4DispatchFunction)XtDispatchEvent);
Note: See TracChangeset
for help on using the changeset viewer.