summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2015-03-30 13:58:12 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2015-04-09 08:25:20 +0000
commitd47294bec7b339792cc38a0be4b05fa6bd79a6ca (patch)
tree4f7d4ae4deafd7791b1bd1312afe053cca635436
parent65fdde30d055b8b69ed9521f8b69f638fc555365 (diff)
Add ReturnKeyType enum to Qt namespace
This will allow to utilize the native return keys provided by most mobile platforms, to indicate what kind of action pressing it will result in, such as performing a search, a navigation, moving on to the next input field or just closing the keyboard. [ChangeLog][QtCore][Global] Added ReturnKeyType enum allowing for fine-grained control of the platform's on screen keyboard return key Change-Id: I6a691045ad6970e6893f23773b2449a7bafd98fc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
-rw-r--r--src/corelib/global/qnamespace.h13
-rw-r--r--src/corelib/global/qnamespace.qdoc31
2 files changed, 44 insertions, 0 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 745fb442f2..c766b4d1c3 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1322,6 +1322,7 @@ public:
ImAbsolutePosition = 0x400,
ImTextBeforeCursor = 0x800,
ImTextAfterCursor = 0x1000,
+ ImReturnKeyType = 0x2000,
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
@@ -1361,6 +1362,17 @@ public:
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
+ enum ReturnKeyType {
+ ReturnKeyDefault,
+ ReturnKeyEnter,
+ ReturnKeyDone,
+ ReturnKeyGo,
+ ReturnKeySend,
+ ReturnKeySearch,
+ ReturnKeyNext,
+ ReturnKeyPrevious
+ };
+
enum ToolButtonStyle {
ToolButtonIconOnly,
ToolButtonTextOnly,
@@ -1681,6 +1693,7 @@ public:
QT_Q_ENUM(InputMethodHint)
QT_Q_ENUM(InputMethodQuery)
QT_Q_FLAG(InputMethodHints)
+ QT_Q_ENUM(ReturnKeyType)
QT_Q_FLAG(InputMethodQueries)
QT_Q_FLAG(TouchPointStates)
QT_Q_ENUM(ScreenOrientation)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ea174abca9..daf55cfd3a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2513,6 +2513,7 @@
but \b{must} not return an empty string unless the cursor is at the start of the document.
\value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return,
but \b{must} not return an empty string unless the cursor is at the end of the document.
+ \value ImReturnKeyType The return key type.
Masks:
@@ -2523,6 +2524,36 @@
*/
/*!
+ \enum Qt::ReturnKeyType
+
+ This can be used to alter the appearance of the Return key on an on screen keyboard.
+
+ Note that not all of these values are supported on all platforms.
+
+ \value ReturnKeyDefault The default return key.
+ This can either be a button closing the keyboard, or a Return button
+ causing a new line in case of a multi-line input field.
+ \value ReturnKeyEnter Show a Return button that inserts a new line.
+ The keyboard will not close when this button is pressed.
+ \value ReturnKeyDone Show a "Done" button.
+ The keyboard will close when this button is pressed.
+ \value ReturnKeyGo Show a "Go" button.
+ Typically used in an address bar when entering an URL; the keyboard
+ will close when this button is pressed.
+ \value ReturnKeySend Show a "Send" button.
+ The keyboard will close when this button is pressed.
+ \value ReturnKeySearch Show a "Search" button.
+ The keyboard will close when this button is pressed.
+ \value ReturnKeyNext Show a "Next" button.
+ Typically used in a form to allow navigating to the next input field;
+ the keyboard will not close when this button is pressed.
+ \value ReturnKeyPrevious Show a "Previous" button.
+ The keyboard will not close when this button is pressed.
+
+ \since 5.6
+*/
+
+/*!
\enum Qt::ItemDataRole
Each item in the model has a set of data elements associated with