MCPcopy Create free account
hub / github.com/KDE/kdevelop / returnPressed

Method returnPressed

kdevplatform/documentation/documentationview.cpp:173–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void DocumentationView::returnPressed()
174{
175 // Exit if search text is empty. It's necessary because of empty
176 // line edit text not leads to "empty" completer indexes.
177 if (mIdentifiers->text().isEmpty())
178 return;
179
180 // Exit if completer popup has selected item - in this case 'Return'
181 // key press emits QCompleter::activated signal which is already connected.
182 if (mIdentifiers->completer()->popup()->currentIndex().isValid())
183 return;
184
185 // If user doesn't select any item in popup we will try to use the first row.
186 if (mIdentifiers->completer()->setCurrentRow(0))
187 changedSelection(mIdentifiers->completer()->currentIndex());
188}
189
190void DocumentationView::changedSelection(const QModelIndex& idx)
191{

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.45
textMethod · 0.45
isValidMethod · 0.45
currentIndexMethod · 0.45

Tested by

no test coverage detected