mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-30 03:13:56 +03:00
fix(ui): fix compilation with Qt 5.9
Qt 5.9 lacks QLineEdit::selectionEnd().
This commit is contained in:
parent
5ef5111bd9
commit
343c7ce078
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user