diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-07 19:31:56 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-07 19:31:57 +0100 |
commit | b8fd0ed3a47558b4ace480526cddffa51d6f0580 (patch) | |
tree | 926095da42e111933bdb3a63c1a9e0a14fa4041f /src/quick/items/qquicktextinput.cpp | |
parent | 669c554516736a6735b7286039c56cc0e8d56e05 (diff) | |
parent | 443ba99b1ef825e198fe1999c34ee44547135797 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 4b816c41c3..2b1141bea8 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1893,11 +1893,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(); } @@ -1907,6 +1911,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() { @@ -4286,10 +4294,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) |