summaryrefslogtreecommitdiff
path: root/debian/patches/0230-qtextcontrol-selectnextword.diff
blob: 91ab87e474259b72f8682f328a6359fd2a4b285a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
qt-bugs@ issue : N213258
Trolltech task ID : 213259
bugs.kde.org number : I guess there is one
applied: no
author: David Faure <faure@kde.org>

Imagine a konqueror window with two tabs, and in the current tab there's a QTextEdit (in a web form).
When typing Ctrl+Shift+Right, it is expected that the next word is selected.
However, the QAction for "move this tab to the right" is triggered, which is unexpected.
This wouldn't happen if the QTextEdit would react to the ShortcutOverride event which
is sent first, for this exact purpose (so that widget-specific shortcuts are done first). 
QTextControl already handles some ShortcutOverride events, but not all of them.
The patch below adds a few useful ones, i.e. possibly-conflicting ones. I guess one could
be exhaustive and list all possible shortcuts there....


--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1065,6 +1065,14 @@
                            || ke == QKeySequence::MoveToPreviousWord
                            || ke == QKeySequence::MoveToStartOfDocument
                            || ke == QKeySequence::MoveToEndOfDocument
+                           || ke == QKeySequence::SelectNextWord
+                           || ke == QKeySequence::SelectPreviousWord
+                           || ke == QKeySequence::SelectStartOfLine
+                           || ke == QKeySequence::SelectEndOfLine
+                           || ke == QKeySequence::SelectStartOfBlock
+                           || ke == QKeySequence::SelectEndOfBlock
+                           || ke == QKeySequence::SelectStartOfDocument
+                           || ke == QKeySequence::SelectEndOfDocument
                           ) {
                     ke->accept();
 #endif