Commit 031fa025 authored by Davide Gianforte's avatar Davide Gianforte

fix compile on Qt < 5.10

parent 259fb603
......@@ -24,6 +24,7 @@
#include "../krglobal.h"
#include "../listpanel.h"
#include "../krcolorcache.h"
#include "../../compat.h"
// QtCore
#include <QDebug>
......@@ -234,7 +235,7 @@ void KrViewItemDelegate::cycleEditorSelection()
return;
}
EditorSelection currentSelection(editor->selectionStart(), editor->selectionLength());
EditorSelection currentSelection(editor->selectionStart(), editor->QLINEEDIT_SELECTIONLENGTH);
auto text = editor->text();
auto selections = generateFileNameSelections(text);
......
......@@ -28,6 +28,17 @@
#define UDS_ENTRY_INSERT(A, B) UDSEntry::insert((A), (B));
#endif
/**
* QLineEdit::selectionLength() is not present in QT < 5.10
*
* This can be removed when the qt minimum version required will be >= 5.10
*/
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#define QLINEEDIT_SELECTIONLENGTH selectionLength()
#else
#define QLINEEDIT_SELECTIONLENGTH selectedText().length()
#endif
/**
* QButtonGroup::buttonClicked(int id) was made obsoleted in QT 5.15 in
* favor of QButtonGroup::idClicked(int id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment