| 4987 | } |
| 4988 | |
| 4989 | void 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 | |
| 5016 | QStandardItemModel* G4UIQt::CreateCompleterModel(const G4String& aCmd) |
| 5017 | { |
nothing calls this directly
no test coverage detected