diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-04-05 12:09:51 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-04-05 12:11:13 +0200 |
commit | 60da655dff4ffcc94d32a05bb5fa32240b0eaa0b (patch) | |
tree | 3f3f9d427570d505d8249053e9646af69a95e783 /src/quick/items/qquicktextinput.cpp | |
parent | 17d435fd8b2ed3a8ac6f93d17d0e78cd61bd7851 (diff) | |
parent | fcbbedc3c21ff69d9251264dd708d6ca66c09359 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I57b06e2e98beb010a56dd0593d93e078ecf76eea
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 3b1901e075..fec9beedf6 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -43,7 +43,7 @@ #include "qquicktextutil_p.h" #include <private/qqmlglobal_p.h> - +#include <private/qv4scopedvalue_p.h> #include <QtCore/qcoreapplication.h> #include <QtCore/qmimedata.h> @@ -711,8 +711,7 @@ void QQuickTextInput::setReadOnly(bool ro) setFlag(QQuickItem::ItemAcceptsInputMethod, !ro); #endif d->m_readOnly = ro; - if (!ro) - d->setCursorPosition(d->end()); + d->setCursorPosition(d->end()); #ifndef QT_NO_IM updateInputMethod(Qt::ImEnabled); #endif @@ -1970,11 +1969,15 @@ bool QQuickTextInput::isRightToLeft(int start, int end) \qmlmethod QtQuick::TextInput::cut() Moves the currently selected text to the system clipboard. + + \note If the echo mode is set to a mode other than Normal then cut + will not work. This is to prevent using cut as a method of bypassing + password features of the line control. */ void QQuickTextInput::cut() { Q_D(QQuickTextInput); - if (!d->m_readOnly) { + if (!d->m_readOnly && d->m_echoMode == QQuickTextInput::Normal) { d->copy(); d->del(); } @@ -1984,6 +1987,10 @@ void QQuickTextInput::cut() \qmlmethod QtQuick::TextInput::copy() Copies the currently selected text to the system clipboard. + + \note If the echo mode is set to a mode other than Normal then copy + will not work. This is to prevent using copy as a method of bypassing + password features of the line control. */ void QQuickTextInput::copy() { @@ -4363,10 +4370,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) } } else if (event == QKeySequence::Cut) { - if (!m_readOnly) { - copy(); - del(); - } + q->cut(); } else if (event == QKeySequence::DeleteEndOfLine) { if (!m_readOnly) |