aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2016-04-05 12:09:51 +0200
committerAndy Nichols <andy.nichols@theqtcompany.com>2016-04-05 12:11:13 +0200
commit60da655dff4ffcc94d32a05bb5fa32240b0eaa0b (patch)
tree3f3f9d427570d505d8249053e9646af69a95e783 /src/quick/items/qquicktextinput.cpp
parent17d435fd8b2ed3a8ac6f93d17d0e78cd61bd7851 (diff)
parentfcbbedc3c21ff69d9251264dd708d6ca66c09359 (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp20
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)