The first time the function is called,
it could fail to set the flags.
Calling setSelectByKeyboard(true) would not actually
set the text interaction flags (was == on).
The test didn't detect it because it called setReadOnly
before setSelectByKeyboard.
Change-Id: Ia54cc782b6ad5a74f1d7029c92fa230116d034b0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
{
Q_D(QQuickTextEdit);
bool was = selectByKeyboard();
- d->selectByKeyboardSet = true;
- if (was != on) {
+ if (!d->selectByKeyboardSet || was != on) {
+ d->selectByKeyboardSet = true;
d->selectByKeyboard = on;
if (on)
d->control->setTextInteractionFlags(d->control->textInteractionFlags() | Qt::TextSelectableByKeyboard);
QVERIFY(edit);
edit->setText(text);
- edit->setReadOnly(readOnly);
edit->setSelectByKeyboard(selectByKeyboard);
+ edit->setReadOnly(readOnly);
edit->setCursorPosition(cursorPosition);
QQuickWindow window;