aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-26 14:16:37 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-26 17:27:35 +0000
commitdf49f17ed62df5a64345f8dcf57e164695a7366f (patch)
treed3bbb26329e247ca5568ee25634d3ccdbd793d65 /src/quick
parentf9b8538de4e6f15922ccc5cfae73e806cc1e67e4 (diff)
QQuickTextInput: handle QKeySequence::DeleteCompleteLine
Change-Id: I56bb1f56a9c37137bab322b699d6345e82449c9c Task-number: QTBUG-49643 Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktextinput.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 087b8b8135..ba7142856b 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1536,7 +1536,8 @@ bool QQuickTextInput::event(QEvent* ev)
|| ke == QKeySequence::SelectEndOfBlock
|| ke == QKeySequence::SelectStartOfDocument
|| ke == QKeySequence::SelectAll
- || ke == QKeySequence::SelectEndOfDocument) {
+ || ke == QKeySequence::SelectEndOfDocument
+ || ke == QKeySequence::DeleteCompleteLine) {
ke->accept();
return true;
} else if (ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier
@@ -4328,6 +4329,14 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
else if (event == QKeySequence::DeleteStartOfWord) {
if (!m_readOnly)
deleteStartOfWord();
+ } else if (event == QKeySequence::DeleteCompleteLine) {
+ if (!m_readOnly) {
+ selectAll();
+#ifndef QT_NO_CLIPBOARD
+ copy();
+#endif
+ del();
+ }
}
#endif // QT_NO_SHORTCUT
else {