diff --git a/src/libs/ui/widgets/searchedit.cpp b/src/libs/ui/widgets/searchedit.cpp index c02dba7..5608ea7 100644 --- a/src/libs/ui/widgets/searchedit.cpp +++ b/src/libs/ui/widgets/searchedit.cpp @@ -73,7 +73,12 @@ void SearchEdit::selectQuery() const int pos = hasSelectedText() ? selectionStart() : cursorPosition(); const int queryPos = queryStart(); const int textSize = text().size(); +#if QT_VERSION >= 0x050A00 // 5.10.0 if (pos >= queryPos && selectionEnd() < textSize) { +#else + const int selectionEnd = hasSelectedText() ? pos + selectedText().size() : -1; + if (pos >= queryPos && selectionEnd < textSize) { +#endif setSelection(queryPos, textSize); return; }