| 171 | } |
| 172 | |
| 173 | void 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 | |
| 190 | void DocumentationView::changedSelection(const QModelIndex& idx) |
| 191 | { |
nothing calls this directly
no test coverage detected