diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-19 15:04:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-19 20:19:09 +0100 |
commit | 7148a79775e31eb5e3053f82f4ee5a9ba702ddae (patch) | |
tree | aceb9ec17fe0008a7c87f09674fac0f99595fafc /src | |
parent | d6625ac911a9aaca544246884aaecc448e7550a0 (diff) |
Make sure that TextInteractionFlags get set.
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquicktextedit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index e30b9cb3fd..feabbba864 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -1265,8 +1265,8 @@ void QQuickTextEdit::setSelectByKeyboard(bool on) { 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); |