Ignore:
Timestamp:
Jun 14, 2007, 5:39:54 PM (17 years ago)
Author:
garnier
Message:

r621@mac-90108: laurentgarnier | 2007-06-14 17:22:43 +0200
en progress

File:
1 edited

Legend:

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

    r510 r511  
    505505  QTreeWidget *treeWidget = new QTreeWidget();
    506506  treeWidget->setColumnCount(2);
     507  treeWidget->setColumnHidden(1,true);
    507508  QStringList labels;
    508509  labels << QString("Summary") << QString("Description");
     
    522523    // look for childs
    523524    CreateChildTree(newItem,treeTop->GetTree(a+1));
    524 
    525525    items.append(newItem);
    526526  }
     
    624624}
    625625void G4UIQt::CreateChildTree(QTreeWidgetItem *a_parent,G4UIcommandTree *a_commandTree) {
    626   printf ("G4UIQt::CreateChildTree \n");
    627626
    628627  // Creating new item
     
    657656   
    658657    QStringList stringList;
     658    stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetTitle()).data()).trimmed()  ;
    659659    stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
    660     stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetTitle()).data()).trimmed()  ;
    661660    newItem = new QTreeWidgetItem(stringList);
    662661     
     
    664663
    665664  }
    666 
    667   printf ("G4UIQt::CreateChildTree  end of for loop\n");
    668665}
    669666
     
    683680    if(UI==NULL) return;
    684681    G4UIcommandTree * treeTop = UI->GetTree();
    685     G4UIcommand* command = treeTop->FindPath(a_treeItem->text (0).toStdString().c_str());
     682    G4UIcommand* command = treeTop->FindPath(a_treeItem->text (1).toStdString().c_str());
    686683    if (command) {
    687       printf ("G4UIQt::CreateChildTree  end of for loop ========\n");
    688       fHelpArea->setText(GetCommandList(treeTop->FindPath(a_treeItem->text (0).toStdString().c_str())));
     684      fHelpArea->setText(GetCommandList(command));
    689685    } else {
    690       printf ("G4UIQt::CreateChildTree  end of for loop ********\n");
     686      // this is not a command, this is a sub directory
     687      // We display the Title
     688      fHelpArea->setText(a_treeItem->text (1).toStdString().c_str());
    691689    }
    692690  }
     
    694692
    695693/**
     694  This fonction return the command list parameters in a QString
     695
    696696 */
    697697/***************************************************************************/
     
    702702/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    703703{
    704   printf ("G4UIQt::CreateChildTree  %s --\n",(char*)(a_command->GetCommandName()).data())  ;
    705704
    706705  QString txt;
     
    714713  txt += "Guidance :\n";
    715714  G4int n_guidanceEntry = a_command->GetGuidanceEntries();
     715
    716716  for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ )
    717     { txt += QString((char*)(a_command->GetGuidanceLine(i_thGuidance)).data()) + "\n"; }
     717    { txt += QString((char*)(a_command->GetGuidanceLine(i_thGuidance)).data()) + "---\n"; }
    718718  if( ! rangeString.isNull() )
    719719    { txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n"; }
    720720  G4int n_parameterEntry = a_command->GetParameterEntries();
    721721  if( n_parameterEntry > 0 )
    722   {
    723     for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
    724       { a_command->GetParameter(i_thParameter)->List(); }
    725   }
     722    {
     723      G4UIparameter *param;
     724
     725      // Re-implementation of G4UIparameter.cc
     726
     727      for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
     728        { param = a_command->GetParameter(i_thParameter);
     729          txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n";
     730          if( ! param->GetParameterGuidance().isNull() )
     731            txt += QString((char*)(param->GetParameterGuidance()).data())+ "\n" ;
     732          txt += " Parameter type  : " + QString(param->GetParameterType())+ "\n";
     733          if(param->IsOmittable())
     734            { txt += " Omittable       : True\n"; }
     735          else
     736            { txt += " Omittable       : False\n"; }
     737          if( param->GetCurrentAsDefault() )
     738            { txt += " Default value   : taken from the current value\n"; }
     739          else if( ! param->GetDefaultValue().isNull() )
     740            { txt += " Default value   : " + QString((char*)(param->GetDefaultValue()).data())+ "\n"; }
     741          if( ! param->GetParameterRange().isNull() )
     742            txt += " Parameter range : " + QString((char*)(param->GetParameterRange()).data())+ "\n";
     743          if( ! param->GetParameterCandidates().isNull() )
     744            txt += " Candidates      : " + QString((char*)(param->GetParameterCandidates()).data())+ "\n";
     745        }
     746    }
    726747  return txt;
    727748}
Note: See TracChangeset for help on using the changeset viewer.