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

Method UpdateCommandCompleter

source/interfaces/implementation/src/G4UIQt.cc:4989–5014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4987}
4988
4989void G4UIQt::UpdateCommandCompleter()
4990{
4991 if (fCommandArea == nullptr) return;
4992
4993 // remove previous one
4994 fCommandArea->setCompleter(nullptr);
4995 if (fCompleter != nullptr) {
4996 if (fCompleter->popup() != nullptr) {
4997 fCompleter->popup()->removeEventFilter(this);
4998 }
4999 }
5000
5001 QStandardItemModel* model = CreateCompleterModel("/");
5002 fCompleter = new QCompleter(model);
5003
5004 // set all dir visibles in completion
5005 G4UImanager* UI = G4UImanager::GetUIpointer();
5006 G4UIcommandTree* commandTreeTop = UI->GetTree();
5007 G4UIcommandTree* aTree = commandTreeTop->FindCommandTree("/");
5008 if (aTree != nullptr) {
5009 G4int Ndir = aTree->GetTreeEntry();
5010 fCompleter->setMaxVisibleItems(Ndir);
5011 }
5012 fCommandArea->setCompleter(fCompleter);
5013 fCompleter->popup()->installEventFilter(this);
5014}
5015
5016QStandardItemModel* G4UIQt::CreateCompleterModel(const G4String& aCmd)
5017{

Callers

nothing calls this directly

Calls 3

FindCommandTreeMethod · 0.80
GetTreeEntryMethod · 0.80
GetTreeMethod · 0.45

Tested by

no test coverage detected