Changeset 619
- Timestamp:
- Nov 27, 2007, 6:04:59 PM (17 years ago)
- Location:
- trunk/geant4/interfaces/basic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/include/G4UIQt.hh
r609 r619 150 150 void HelpTreeClicCallback(); 151 151 #if QT_VERSION < 0x040000 152 void HelpTreeDoubleClicCallback( QListViewItem* , int);152 void HelpTreeDoubleClicCallback( QListViewItem*); 153 153 #else 154 void HelpTreeDoubleClicCallback( QTreeWidgetItem*, 154 void HelpTreeDoubleClicCallback( QTreeWidgetItem*,int); 155 155 #endif 156 156 void ShowHelpCallback(); -
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r617 r619 171 171 connect(fCommandHistoryArea, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback())); 172 172 #endif 173 fCommandHistoryArea->addColumn(""); 174 fCommandHistoryArea->header()->hide(); 175 173 176 fCommandHistoryArea->installEventFilter(this); 174 177 fCommandLabel = new QLabel("",bottomWidget); … … 566 569 fHelpDialog = new QDialog(fMainWindow,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax ); 567 570 QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog); 568 Q Widget* global = new QWidget(fHelpDialog);571 QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog); 569 572 #else 570 573 QVBoxLayout *vLayout = new QVBoxLayout(); 571 574 fHelpDialog = new QDialog(fMainWindow,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); 572 #endif 573 QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog); 574 575 QPushButton *exitButton = new QPushButton("Exit",fMainWindow); 575 QSplitter *splitter = new QSplitter(Qt::Horizontal); 576 #endif 577 QPushButton *exitButton = new QPushButton("Exit",fHelpDialog); 576 578 connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close())); 577 579 … … 585 587 fHelpTreeWidget = new QListView(splitter); 586 588 fHelpTreeWidget->setSelectionMode(QListView::Single); 589 fHelpTreeWidget->setRootIsDecorated(true); 587 590 fHelpTreeWidget->addColumn("Command"); 588 fHelpTreeWidget->addColumn("Description" );589 fHelpTreeWidget->setColumnWidth (1,0);591 fHelpTreeWidget->addColumn("Description",0); 592 // fHelpTreeWidget->setColumnWidth (1,0); 590 593 fHelpTreeWidget->header()->setResizeEnabled(FALSE,1); 591 594 // QList<QListViewItem *> items; … … 651 654 } 652 655 656 #if QT_VERSION < 0x040000 657 connect(fHelpTreeWidget, SIGNAL(selectionChanged ()),this, SLOT(HelpTreeClicCallback())); 658 connect(fHelpTreeWidget, SIGNAL(doubleClicked (QListViewItem*)),this, SLOT(HelpTreeDoubleClicCallback(QListViewItem*))); 659 #else 653 660 connect(fHelpTreeWidget, SIGNAL(itemSelectionChanged ()),this, SLOT(HelpTreeClicCallback())); 654 connect(fHelpTreeWidget, SIGNAL(itemDoubleClicked (QTreeWidgetItem*,int)),this, SLOT(HelpTreeDoubleClicCallback(QTreeWidgetItem*,int))); 661 connect(fHelpTreeWidget, SIGNAL(itemDoubleClicked (QTreeWidgetItem*,int)),this, SLOT(HelpTreeDoubleClicCallback(QTreeWidgetItem*))); 662 #endif 655 663 656 664 // Set layouts … … 662 670 663 671 664 #if QT_VERSION < 0x040000 665 vLayout->addWidget(global); 666 #else 672 #if QT_VERSION >= 0x040000 667 673 vLayout->addWidget(splitter); 668 #endif669 674 vLayout->addWidget(exitButton); 675 #else 676 vLayout->add(splitter); 677 vLayout->addWidget(exitButton); 678 #endif 679 680 // set the splitter size 681 #if QT_VERSION >= 0x040000 682 QList<int> list; 683 #else 684 QValueList<int> list; 685 #endif 686 list.append( 400 ); 687 list.append( 400 ); 688 splitter->setSizes(list); 689 670 690 #if QT_VERSION >= 0x040000 671 691 fHelpDialog->setLayout(vLayout); … … 1142 1162 ) 1143 1163 { 1164 #ifdef GEANT4_QT_DEBUG 1165 printf("G4UIQt::CommandEnteredCallback\n"); 1166 #endif 1144 1167 #if QT_VERSION < 0x040000 1145 1168 G4String command (fCommandArea->text().ascii()); … … 1148 1171 QListViewItem *newItem = new QListViewItem(fCommandHistoryArea); 1149 1172 newItem->setText(0,fCommandArea->text()); 1173 fCommandHistoryArea->insertItem(newItem); 1174 #ifdef GEANT4_QT_DEBUG 1175 printf("G4UIQt::CommandEnteredCallback 2\n"); 1176 #endif 1150 1177 #else 1151 1178 G4String command (fCommandArea->text().toStdString().c_str()); … … 1166 1193 TerminalHelp(command); 1167 1194 } 1168 #ifdef GEANT4_QT_DEBUG1169 printf("after \n");1170 #endif1171 1195 if(exitSession==true) 1172 1196 SessionTerminate(); … … 1200 1224 ) 1201 1225 { 1202 // printf("G4UIQt::HelpTreeClicCallback"); 1226 #ifdef GEANT4_QT_DEBUG 1227 printf("G4UIQt::HelpTreeClicCallback"); 1228 #endif 1229 1203 1230 #if QT_VERSION < 0x040000 1204 1231 QListViewItem* item = NULL; … … 1265 1292 #else 1266 1293 QTreeWidgetItem* item 1267 #endif 1268 ,int 1269 ) 1270 { 1271 #ifdef GEANT4_QT_DEBUG 1272 printf("G4UIQt::HelpTreeDoubleClicCallback"); 1273 #endif 1294 ,int 1295 #endif 1296 ) 1297 { 1274 1298 HelpTreeClicCallback(); 1275 1299 fCommandArea->setText(item->text (1)); -
trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc
r615 r619 15 15 #include <qapplication.h> 16 16 17 #if QT_VERSION < 0x04000017 #if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 26) 18 18 19 19 #include <private/qucomextra_p.h> … … 66 66 static const QUMethod slot_4 = {"HelpTreeClicCallback", 0, 0 }; 67 67 static const QUParameter param_slot_5[] = { 68 { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In }, 69 { 0, &static_QUType_int, 0, QUParameter::In } 70 }; 71 static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 2, param_slot_5 }; 68 { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In } 69 }; 70 static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 1, param_slot_5 }; 72 71 static const QUMethod slot_6 = {"ShowHelpCallback", 0, 0 }; 73 72 static const QUMethod slot_7 = {"CommandHistoryCallback", 0, 0 }; … … 78 77 { "ButtonCallback(const QString&)", &slot_3, QMetaData::Private }, 79 78 { "HelpTreeClicCallback()", &slot_4, QMetaData::Private }, 80 { "HelpTreeDoubleClicCallback(QListViewItem* ,int)", &slot_5, QMetaData::Private },79 { "HelpTreeDoubleClicCallback(QListViewItem*)", &slot_5, QMetaData::Private }, 81 80 { "ShowHelpCallback()", &slot_6, QMetaData::Private }, 82 81 { "CommandHistoryCallback()", &slot_7, QMetaData::Private } … … 127 126 case 3: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break; 128 127 case 4: HelpTreeClicCallback(); break; 129 case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1) ,(int)static_QUType_int.get(_o+2)); break;128 case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1)); break; 130 129 case 6: ShowHelpCallback(); break; 131 130 case 7: CommandHistoryCallback(); break; … … 160 159 161 160 162 #if QT_VERSION < 0x040200 161 #if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 58) 162 163 163 /**************************************************************************** 164 164 ** Meta object code from reading C++ file 'G4UIQt.hh' … … 262 262 #else 263 263 264 #if QT_VERSION >= 0x040000 264 #if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 59) 265 265 266 /**************************************************************************** 266 267 ** Meta object code from reading C++ file 'G4UIQt.hh'
Note: See TracChangeset
for help on using the changeset viewer.