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>
This commit is contained in:
Kai Uwe Broulik 2015-03-30 13:58:12 +02:00
parent 65fdde30d0
commit d47294bec7
2 changed files with 44 additions and 0 deletions

View File

@ -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)

View File

@ -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:
@ -2522,6 +2523,36 @@
\sa QInputMethodQueryEvent
*/
/*!
\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