Changeset 511 for trunk/geant4/interfaces/basic/src/G4UIQt.cc
- Timestamp:
- Jun 14, 2007, 5:39:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r510 r511 505 505 QTreeWidget *treeWidget = new QTreeWidget(); 506 506 treeWidget->setColumnCount(2); 507 treeWidget->setColumnHidden(1,true); 507 508 QStringList labels; 508 509 labels << QString("Summary") << QString("Description"); … … 522 523 // look for childs 523 524 CreateChildTree(newItem,treeTop->GetTree(a+1)); 524 525 525 items.append(newItem); 526 526 } … … 624 624 } 625 625 void G4UIQt::CreateChildTree(QTreeWidgetItem *a_parent,G4UIcommandTree *a_commandTree) { 626 printf ("G4UIQt::CreateChildTree \n");627 626 628 627 // Creating new item … … 657 656 658 657 QStringList stringList; 658 stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetTitle()).data()).trimmed() ; 659 659 stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed() ; 660 stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetTitle()).data()).trimmed() ;661 660 newItem = new QTreeWidgetItem(stringList); 662 661 … … 664 663 665 664 } 666 667 printf ("G4UIQt::CreateChildTree end of for loop\n");668 665 } 669 666 … … 683 680 if(UI==NULL) return; 684 681 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()); 686 683 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)); 689 685 } 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()); 691 689 } 692 690 } … … 694 692 695 693 /** 694 This fonction return the command list parameters in a QString 695 696 696 */ 697 697 /***************************************************************************/ … … 702 702 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 703 703 { 704 printf ("G4UIQt::CreateChildTree %s --\n",(char*)(a_command->GetCommandName()).data()) ;705 704 706 705 QString txt; … … 714 713 txt += "Guidance :\n"; 715 714 G4int n_guidanceEntry = a_command->GetGuidanceEntries(); 715 716 716 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"; } 718 718 if( ! rangeString.isNull() ) 719 719 { txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n"; } 720 720 G4int n_parameterEntry = a_command->GetParameterEntries(); 721 721 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 } 726 747 return txt; 727 748 }
Note: See TracChangeset
for help on using the changeset viewer.