MCPcopy Create free account
hub / github.com/Geant4/geant4 / ActWithAString

Method ActWithAString

source/interfaces/implementation/src/G4UIQt.cc:2220–2240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2218}
2219
2220void G4UIQt::NewSceneTreeItemTreeWidget::ActWithAString
2221 (const G4String& action, G4SceneTreeItem* sceneTreeItem)
2222{
2223 auto uiMan = G4UImanager::GetUIpointer();
2224 auto command = uiMan->FindCommand("/vis/touchable/set/" + action);
2225 if (command) {
2226 QStringList qStringList;
2227 const auto& candidates = command->GetParameter(0)->GetParameterCandidates();
2228 std::istringstream iss(candidates);
2229 G4String candidate;
2230 while (iss >> candidate) qStringList.append(candidate.c_str());
2231 G4bool ok = true;
2232 auto chosenValue = QInputDialog::getItem(this, action.c_str(), action.c_str(), qStringList,
2233 0, false, &ok);
2234 if (ok) {
2235 uiMan->ApplyCommand("/vis/set/touchable" + sceneTreeItem->GetPVPath());
2236 G4String g4ChosenValue = chosenValue.toStdString();
2237 uiMan->ApplyCommand("/vis/touchable/set/" + action + ' ' + g4ChosenValue);
2238 }
2239 }
2240}
2241
2242
2243/** Create the History ToolBox Widget

Callers

nothing calls this directly

Calls 5

GetParameterMethod · 0.80
c_strMethod · 0.80
FindCommandMethod · 0.45
appendMethod · 0.45
ApplyCommandMethod · 0.45

Tested by

no test coverage detected