Changeset 700 for trunk/geant4


Ignore:
Timestamp:
Jan 28, 2008, 5:51:08 PM (16 years ago)
Author:
garnier
Message:

zone de recherche OK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r699 r700  
    747747  fHelpTreeWidget->setRootIsDecorated(true);
    748748  fHelpTreeWidget->addColumn("Command");
    749   fHelpTreeWidget->addColumn("Description",0);
    750   //    fHelpTreeWidget->setColumnWidth (1,0);
    751749  fHelpTreeWidget->header()->setResizeEnabled(FALSE,1);
    752   //    QList<QListViewItem *> items;
    753750#else
    754751  fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    755   fHelpTreeWidget->setColumnCount(2);
    756   fHelpTreeWidget->setColumnHidden(1,true);
    757752  QStringList labels;
    758   labels << QString("Command") << QString("Description");
     753  labels << QString("Command");
    759754  fHelpTreeWidget->setHeaderLabels(labels);
    760   //    QList<QTreeWidgetItem *> items;
    761755#endif
    762756
     
    773767    newItem = new QListViewItem(fHelpTreeWidget);
    774768    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());
    776769#else
    777770    newItem = new QTreeWidgetItem(fHelpTreeWidget);
    778771    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());
    780772#endif
    781773
     
    832824      newItem = new QListViewItem(aParent);
    833825      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());
    835826
    836827#else
    837828    newItem = new QTreeWidgetItem(aParent);
    838829    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());
    840830#endif
    841831
     
    853843    newItem = new QListViewItem(aParent);
    854844    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());
    856845    newItem->setOpen(false);
    857846
     
    859848    newItem = new QTreeWidgetItem(aParent);
    860849    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());
    862850#if QT_VERSION < 0x040202
    863851        fHelpTreeWidget->setItemExpanded(newItem,false);
     
    13131301
    13141302  fCommandArea->clear();
    1315   fCommandArea->setText(item->text(1));
     1303  fCommandArea->setText(item->text(0));
    13161304}
    13171305
     
    14161404  fHelpTreeWidget->setRootIsDecorated(true);
    14171405  fHelpTreeWidget->addColumn("Command");
    1418   fHelpTreeWidget->addColumn("Description",0);
    14191406  fHelpTreeWidget->addColumn("Match");
    14201407  //  fHelpTreeWidget->header()->setResizeEnabled(FALSE,1);
    14211408#else
    14221409  fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    1423   fHelpTreeWidget->setColumnCount(3);
    1424   fHelpTreeWidget->setColumnHidden(1,true);
     1410  fHelpTreeWidget->setColumnCount(2);
    14251411  QStringList labels;
    1426   labels << QString("Command") << QString("Description") << QString("Match");
     1412  labels << QString("Command") << QString("Match");
    14271413  fHelpTreeWidget->setHeaderLabels(labels);
    14281414#endif
     
    14611447    newItem = new QListViewItem(fHelpTreeWidget);
    14621448    newItem->setText(0,i.value().simplifyWhiteSpace());
    1463     newItem->setText(1,i.value().simplifyWhiteSpace());
    1464    
    1465     newItem->setText(2,progressStr);
     1449    newItem->setText(1,progressStr);
    14661450#else
    14671451    newItem = new QTreeWidgetItem(fHelpTreeWidget);
    14681452    newItem->setText(0,i.value().trimmed());
    1469     newItem->setText(1,i.value().trimmed());
    1470     newItem->setText(2,progressStr);
     1453    newItem->setText(1,progressStr);
    14711454#endif
    14721455   
    14731456#if QT_VERSION >= 0x040200
    1474     newItem->setForeground ( 2, QBrush(Qt::blue) );
     1457    newItem->setForeground ( 1, QBrush(Qt::blue) );
    14751458#endif
    14761459    progressStr = "|";
     
    14791462  // FIXME :  to be checked on Qt3
    14801463#if QT_VERSION < 0x040000
    1481   fHelpTreeWidget->setColumnWidthMode (0,QListView::Maximum);
     1464  fHelpTreeWidget->setColumnWidthMode (1,QListView::Maximum);
    14821465#else
    14831466  fHelpTreeWidget->resizeColumnToContents (0);
     1467  //  fHelpTreeWidget->setColumnWidth(1,10);//resizeColumnToContents (1);
    14841468#endif
    14851469}
     
    15021486  for (int a=0;a<aCommandTree->GetTreeEntry();a++) {
    15031487    const G4UIcommand* command = aCommandTree->GetGuidance();
    1504 #ifdef GEANT4_QT_DEBUG
    1505     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 #endif
    15091488    tmp = GetCommandList (command).count(text,Qt::CaseInsensitive);
    15101489    if (tmp >0) {
    15111490      commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()));
    1512 #ifdef GEANT4_QT_DEBUG
    1513       printf("---Command %s match %d times \n",(char*)(aCommandTree->GetTree(a+1)->GetPathName()).data(),tmp);
    1514 #endif
    15151491    }
    15161492    // look for childs
     
    15321508    const G4UIcommand* command = aCommandTree->GetCommand(a+1);
    15331509#ifdef GEANT4_QT_DEBUG
    1534     printf("Command Finale debut\n");
    15351510    //    printf("%s \n",GetCommandList (command).toStdString().c_str());
    15361511#endif
     
    15391514      commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()));
    15401515#ifdef GEANT4_QT_DEBUG
    1541       printf("---Command Finale %s match %d times \n",(char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data(),tmp);
    15421516#endif
    15431517    }
Note: See TracChangeset for help on using the changeset viewer.