Changeset 620
- Timestamp:
- Nov 28, 2007, 11:28:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r619 r620 164 164 #if QT_VERSION < 0x040000 165 165 fCommandHistoryArea = new QListView(bottomWidget); 166 167 fCommandHistoryArea->setSorting (-1, FALSE); 166 168 fCommandHistoryArea->setSelectionMode(QListView::Single); 169 fCommandHistoryArea->addColumn(""); 170 fCommandHistoryArea->header()->hide(); 167 171 connect(fCommandHistoryArea, SIGNAL(selectionChanged()), SLOT(CommandHistoryCallback())); 168 172 #else … … 171 175 connect(fCommandHistoryArea, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback())); 172 176 #endif 173 fCommandHistoryArea->addColumn("");174 fCommandHistoryArea->header()->hide();175 177 176 178 fCommandHistoryArea->installEventFilter(this); … … 188 190 #endif 189 191 connect(fCommandArea, SIGNAL(returnPressed()), SLOT(CommandEnteredCallback())); 192 #ifdef GEANT4_QT_DEBUG 193 printf("G4UIQt:: 1 connect returnPressed\n"); 194 #endif 190 195 #if QT_VERSION < 0x040000 191 196 fCommandArea->setFocusPolicy ( QWidget::StrongFocus ); … … 490 495 ) 491 496 { 492 #ifdef GEANT4_QT_DEBUG493 printf("G4UIQt::AddMenu 1\n");494 #endif495 497 if (aName == NULL) return; 496 498 if (aLabel == NULL) return; 497 499 498 #ifdef GEANT4_QT_DEBUG499 printf("G4UIQt::AddMenu 2 %s %s\n",aName,aLabel);500 #endif501 500 #if QT_VERSION < 0x040000 502 501 QPopupMenu *fileMenu = new QPopupMenu( fMainWindow); … … 536 535 537 536 QSignalMapper *signalMapper = new QSignalMapper(this); 538 #if QT_VERSION < 0x040000539 537 #if QT_VERSION < 0x030200 540 538 QAction *action = new QAction(QString(aLabel),QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map())); 541 #else 539 action->addTo(parent); 540 connect(action,SIGNAL(activated()),signalMapper,SLOT(map())); 541 542 #elif QT_VERSION < 0x040000 542 543 QAction *action = new QAction(QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map())); 543 #endif544 544 action->addTo(parent); 545 connect(action,SIGNAL(clicked()),signalMapper,SLOT(map())); 546 545 547 #else 546 548 QAction *action = parent->addAction(aLabel, signalMapper, SLOT(map())); 547 #endif 549 550 #endif 551 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ButtonCallback(const QString&))); 548 552 signalMapper->setMapping(action, QString(aCommand)); 549 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ButtonCallback(const QString&)));550 553 } 551 554 … … 1162 1165 ) 1163 1166 { 1164 #ifdef GEANT4_QT_DEBUG1165 printf("G4UIQt::CommandEnteredCallback\n");1166 #endif1167 1167 #if QT_VERSION < 0x040000 1168 1168 G4String command (fCommandArea->text().ascii()); … … 1172 1172 newItem->setText(0,fCommandArea->text()); 1173 1173 fCommandHistoryArea->insertItem(newItem); 1174 #ifdef GEANT4_QT_DEBUG 1175 printf("G4UIQt::CommandEnteredCallback 2\n"); 1176 #endif 1174 // now we have to arrange 1175 QListViewItem *temp= fCommandHistoryArea->lastItem(); 1176 for (int i=0; i<fCommandHistoryArea->childCount()-1;i++) { 1177 fCommandHistoryArea->takeItem(temp); 1178 fCommandHistoryArea->insertItem(temp); 1179 temp= fCommandHistoryArea->lastItem(); 1180 } 1177 1181 #else 1178 1182 G4String command (fCommandArea->text().toStdString().c_str()); … … 1207 1211 ) 1208 1212 { 1213 1209 1214 #if QT_VERSION < 0x040000 1210 1215 G4String ss = G4String(aCommand.ascii()); … … 1224 1229 ) 1225 1230 { 1226 #ifdef GEANT4_QT_DEBUG1227 printf("G4UIQt::HelpTreeClicCallback");1228 #endif1229 1230 1231 #if QT_VERSION < 0x040000 1231 1232 QListViewItem* item = NULL; … … 1314 1315 if (!fCommandHistoryArea) 1315 1316 return ; 1316 1317 1317 1318 1318 #if QT_VERSION < 0x040000 1319 item =f HelpTreeWidget->selectedItem();1319 item =fCommandHistoryArea->selectedItem(); 1320 1320 #else 1321 1321 QList<QListWidgetItem *> list =fCommandHistoryArea->selectedItems();
Note: See TracChangeset
for help on using the changeset viewer.