- Timestamp:
- Jan 28, 2008, 5:51:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r699 r700 747 747 fHelpTreeWidget->setRootIsDecorated(true); 748 748 fHelpTreeWidget->addColumn("Command"); 749 fHelpTreeWidget->addColumn("Description",0);750 // fHelpTreeWidget->setColumnWidth (1,0);751 749 fHelpTreeWidget->header()->setResizeEnabled(FALSE,1); 752 // QList<QListViewItem *> items;753 750 #else 754 751 fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); 755 fHelpTreeWidget->setColumnCount(2);756 fHelpTreeWidget->setColumnHidden(1,true);757 752 QStringList labels; 758 labels << QString("Command") << QString("Description");753 labels << QString("Command"); 759 754 fHelpTreeWidget->setHeaderLabels(labels); 760 // QList<QTreeWidgetItem *> items;761 755 #endif 762 756 … … 773 767 newItem = new QListViewItem(fHelpTreeWidget); 774 768 newItem->setText(0,QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()).simplifyWhiteSpace()); 775 newItem->setText(1,QString((char*)(treeTop->GetTree(a+1)->GetTitle()).data()).simplifyWhiteSpace());776 769 #else 777 770 newItem = new QTreeWidgetItem(fHelpTreeWidget); 778 771 newItem->setText(0,QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()).trimmed()); 779 newItem->setText(1,QString((char*)(treeTop->GetTree(a+1)->GetTitle()).data()).trimmed());780 772 #endif 781 773 … … 832 824 newItem = new QListViewItem(aParent); 833 825 newItem->setText(0,QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()).simplifyWhiteSpace()); 834 newItem->setText(1,QString((char*)(aCommandTree->GetTree(a+1)->GetTitle()).data()).simplifyWhiteSpace());835 826 836 827 #else 837 828 newItem = new QTreeWidgetItem(aParent); 838 829 newItem->setText(0,QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()).trimmed()); 839 newItem->setText(1,QString((char*)(aCommandTree->GetTree(a+1)->GetTitle()).data()).trimmed());840 830 #endif 841 831 … … 853 843 newItem = new QListViewItem(aParent); 854 844 newItem->setText(0,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).simplifyWhiteSpace()); 855 newItem->setText(1,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).simplifyWhiteSpace());856 845 newItem->setOpen(false); 857 846 … … 859 848 newItem = new QTreeWidgetItem(aParent); 860 849 newItem->setText(0,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()); 861 newItem->setText(1,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed());862 850 #if QT_VERSION < 0x040202 863 851 fHelpTreeWidget->setItemExpanded(newItem,false); … … 1313 1301 1314 1302 fCommandArea->clear(); 1315 fCommandArea->setText(item->text( 1));1303 fCommandArea->setText(item->text(0)); 1316 1304 } 1317 1305 … … 1416 1404 fHelpTreeWidget->setRootIsDecorated(true); 1417 1405 fHelpTreeWidget->addColumn("Command"); 1418 fHelpTreeWidget->addColumn("Description",0);1419 1406 fHelpTreeWidget->addColumn("Match"); 1420 1407 // fHelpTreeWidget->header()->setResizeEnabled(FALSE,1); 1421 1408 #else 1422 1409 fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); 1423 fHelpTreeWidget->setColumnCount(3); 1424 fHelpTreeWidget->setColumnHidden(1,true); 1410 fHelpTreeWidget->setColumnCount(2); 1425 1411 QStringList labels; 1426 labels << QString("Command") << QString(" Description") << QString("Match");1412 labels << QString("Command") << QString("Match"); 1427 1413 fHelpTreeWidget->setHeaderLabels(labels); 1428 1414 #endif … … 1461 1447 newItem = new QListViewItem(fHelpTreeWidget); 1462 1448 newItem->setText(0,i.value().simplifyWhiteSpace()); 1463 newItem->setText(1,i.value().simplifyWhiteSpace()); 1464 1465 newItem->setText(2,progressStr); 1449 newItem->setText(1,progressStr); 1466 1450 #else 1467 1451 newItem = new QTreeWidgetItem(fHelpTreeWidget); 1468 1452 newItem->setText(0,i.value().trimmed()); 1469 newItem->setText(1,i.value().trimmed()); 1470 newItem->setText(2,progressStr); 1453 newItem->setText(1,progressStr); 1471 1454 #endif 1472 1455 1473 1456 #if QT_VERSION >= 0x040200 1474 newItem->setForeground ( 2, QBrush(Qt::blue) );1457 newItem->setForeground ( 1, QBrush(Qt::blue) ); 1475 1458 #endif 1476 1459 progressStr = "|"; … … 1479 1462 // FIXME : to be checked on Qt3 1480 1463 #if QT_VERSION < 0x040000 1481 fHelpTreeWidget->setColumnWidthMode ( 0,QListView::Maximum);1464 fHelpTreeWidget->setColumnWidthMode (1,QListView::Maximum); 1482 1465 #else 1483 1466 fHelpTreeWidget->resizeColumnToContents (0); 1467 // fHelpTreeWidget->setColumnWidth(1,10);//resizeColumnToContents (1); 1484 1468 #endif 1485 1469 } … … 1502 1486 for (int a=0;a<aCommandTree->GetTreeEntry();a++) { 1503 1487 const G4UIcommand* command = aCommandTree->GetGuidance(); 1504 #ifdef GEANT4_QT_DEBUG1505 printf("Command loop \n");1506 // printf("Command %s\n",(char*)(aCommandTree->GetTree(a+1)->GetPathName()).data());1507 // printf("%s \n",GetCommandList (command).toStdString().c_str());1508 #endif1509 1488 tmp = GetCommandList (command).count(text,Qt::CaseInsensitive); 1510 1489 if (tmp >0) { 1511 1490 commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data())); 1512 #ifdef GEANT4_QT_DEBUG1513 printf("---Command %s match %d times \n",(char*)(aCommandTree->GetTree(a+1)->GetPathName()).data(),tmp);1514 #endif1515 1491 } 1516 1492 // look for childs … … 1532 1508 const G4UIcommand* command = aCommandTree->GetCommand(a+1); 1533 1509 #ifdef GEANT4_QT_DEBUG 1534 printf("Command Finale debut\n");1535 1510 // printf("%s \n",GetCommandList (command).toStdString().c_str()); 1536 1511 #endif … … 1539 1514 commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data())); 1540 1515 #ifdef GEANT4_QT_DEBUG 1541 printf("---Command Finale %s match %d times \n",(char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data(),tmp);1542 1516 #endif 1543 1517 }
Note: See TracChangeset
for help on using the changeset viewer.