summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2015-06-01 11:14:04 +0200
committerKai Uwe Broulik <kde@privat.broulik.de>2015-06-03 07:55:02 +0000
commitdd274a5455296fcfe8631c2c2c7271546e9547bc (patch)
tree21b87d339eb3b97de1f662c33ed1df3695c8f844
parent933bf178aab88ab5df8a68cbf02611d6d8744b1b (diff)
Rename ReturnKey to EnterKey
This makes the terminology consistent with Sailfish OS and the QNX QPA. The kImePlatformDataReturnKeyType in the iOS QPA is not changed to not break compatibility. Also, improve documentation. Change-Id: I2780de5b1e9277185ae1d4d9bbc67e36682fbfba Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
-rw-r--r--src/corelib/global/qnamespace.h22
-rw-r--r--src/corelib/global/qnamespace.qdoc47
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm2
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm18
4 files changed, 45 insertions, 44 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 123e2edf0e..c6465ed087 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1323,7 +1323,7 @@ public:
ImAbsolutePosition = 0x400,
ImTextBeforeCursor = 0x800,
ImTextAfterCursor = 0x1000,
- ImReturnKeyType = 0x2000,
+ ImEnterKeyType = 0x2000,
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
@@ -1363,15 +1363,15 @@ public:
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
- enum ReturnKeyType {
- ReturnKeyDefault,
- ReturnKeyEnter,
- ReturnKeyDone,
- ReturnKeyGo,
- ReturnKeySend,
- ReturnKeySearch,
- ReturnKeyNext,
- ReturnKeyPrevious
+ enum EnterKeyType {
+ EnterKeyDefault,
+ EnterKeyReturn,
+ EnterKeyDone,
+ EnterKeyGo,
+ EnterKeySend,
+ EnterKeySearch,
+ EnterKeyNext,
+ EnterKeyPrevious
};
enum ToolButtonStyle {
@@ -1697,7 +1697,7 @@ public:
QT_Q_ENUM(InputMethodHint)
QT_Q_ENUM(InputMethodQuery)
QT_Q_FLAG(InputMethodHints)
- QT_Q_ENUM(ReturnKeyType)
+ QT_Q_ENUM(EnterKeyType)
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 d4d7b631ad..b981fed500 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2527,7 +2527,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.
+ \value ImEnterKeyType The Enter key type.
Masks:
@@ -2538,31 +2538,32 @@
*/
/*!
- \enum Qt::ReturnKeyType
+ \enum Qt::EnterKeyType
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.
+ \note Not all of these values are supported on all platforms.
+ For unsuppoted values the default key will be used instead.
+
+ \value EnterKeyDefault The default Enter 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 EnterKeyReturn Show a Return button that inserts a new line.
+ The keyboard will not close when this button is pressed.
+ \value EnterKeyDone Show a "Done" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyGo Show a "Go" button.
+ Typically used in an address bar when entering a URL; the keyboard
+ will close when this button is pressed.
+ \value EnterKeySend Show a "Send" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeySearch Show a "Search" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyNext 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 EnterKeyPrevious Show a "Previous" button.
+ The keyboard will not close when this button is pressed.
\since 5.6
*/
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 037b28e91d..d03c589b2a 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -579,7 +579,7 @@ void QIOSInputContext::focusWindowChanged(QWindow *focusWindow)
void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties)
{
// Mask for properties that we are interested in and see if any of them changed
- updatedProperties &= (Qt::ImEnabled | Qt::ImHints | Qt::ImQueryInput | Qt::ImReturnKeyType | Qt::ImPlatformData);
+ updatedProperties &= (Qt::ImEnabled | Qt::ImHints | Qt::ImQueryInput | Qt::ImEnterKeyType | Qt::ImPlatformData);
qImDebug() << "fw =" << qApp->focusWindow() << "fo =" << qApp->focusObject();
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index c7356d7abd..d86f545154 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -170,25 +170,25 @@
QVariantMap platformData = m_configuredImeState->value(Qt::ImPlatformData).toMap();
Qt::InputMethodHints hints = Qt::InputMethodHints(m_configuredImeState->value(Qt::ImHints).toUInt());
- Qt::ReturnKeyType returnKeyType = Qt::ReturnKeyType(m_configuredImeState->value(Qt::ImReturnKeyType).toUInt());
+ Qt::EnterKeyType enterKeyType = Qt::EnterKeyType(m_configuredImeState->value(Qt::ImEnterKeyType).toUInt());
- switch (returnKeyType) {
- case Qt::ReturnKeyEnter:
+ switch (enterKeyType) {
+ case Qt::EnterKeyReturn:
self.returnKeyType = UIReturnKeyDefault;
break;
- case Qt::ReturnKeyDone:
+ case Qt::EnterKeyDone:
self.returnKeyType = UIReturnKeyDone;
break;
- case Qt::ReturnKeyGo:
+ case Qt::EnterKeyGo:
self.returnKeyType = UIReturnKeyGo;
break;
- case Qt::ReturnKeySend:
+ case Qt::EnterKeySend:
self.returnKeyType = UIReturnKeySend;
break;
- case Qt::ReturnKeySearch:
+ case Qt::EnterKeySearch:
self.returnKeyType = UIReturnKeySearch;
break;
- case Qt::ReturnKeyNext:
+ case Qt::EnterKeyNext:
self.returnKeyType = UIReturnKeyNext;
break;
default:
@@ -255,7 +255,7 @@
}
// Based on what we set up in initWithInputContext above
- updatedProperties &= (Qt::ImHints | Qt::ImReturnKeyType | Qt::ImPlatformData);
+ updatedProperties &= (Qt::ImHints | Qt::ImEnterKeyType | Qt::ImPlatformData);
if (!updatedProperties)
return NO;