Changeset 619 for trunk/geant4/interfaces/basic/src/G4UIQt.cc
- Timestamp:
- Nov 27, 2007, 6:04:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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));
Note: See TracChangeset
for help on using the changeset viewer.