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

Method HelpTreeClicCallback

source/interfaces/implementation/src/G4UIQt.cc:5367–5402  ·  view source on GitHub ↗

This callback is activated when user selected a item in the help tree */

Source from the content-addressed store, hash-verified

5365/** This callback is activated when user selected a item in the help tree
5366 */
5367void G4UIQt::HelpTreeClicCallback()
5368{
5369 QTreeWidgetItem* item = nullptr;
5370 if (fHelpTreeWidget == nullptr) return;
5371
5372 QList<QTreeWidgetItem*> list = fHelpTreeWidget->selectedItems();
5373 if (list.isEmpty()) return;
5374 item = list.first();
5375 if (item == nullptr) return;
5376
5377 G4UImanager* UI = G4UImanager::GetUIpointer();
5378 if (UI == nullptr) return;
5379 G4UIcommandTree* treeTop = UI->GetTree();
5380
5381 std::string itemText = GetLongCommandPath(item).toStdString();
5382
5383 // check if it is a command path
5384 if (item->childCount() > 0) {
5385 itemText += "/";
5386 }
5387 G4UIcommand* command = treeTop->FindPath(itemText.c_str());
5388
5389 if (command != nullptr) {
5390 updateHelpArea(command);
5391 }
5392 else { // this is a command
5393 G4UIcommandTree* path = treeTop->FindCommandTree(itemText.c_str());
5394 if (path != nullptr) {
5395 // this is not a command, this is a sub directory
5396 // We display the Title
5397 fParameterHelpLabel->setVisible(true);
5398 fParameterHelpLabel->setText(path->GetTitle().data());
5399 fParameterHelpTable->setVisible(false);
5400 }
5401 }
5402}
5403
5404/** This callback is activated when user double clic on a item in the help tree
5405 */

Callers

nothing calls this directly

Calls 8

FindPathMethod · 0.80
c_strMethod · 0.80
FindCommandTreeMethod · 0.80
setVisibleMethod · 0.80
firstMethod · 0.45
GetTreeMethod · 0.45
dataMethod · 0.45
GetTitleMethod · 0.45

Tested by

no test coverage detected