diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2016-11-23 21:56:56 +0200 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2016-12-07 19:48:50 +0000 |
commit | adabc870bc1e60bb57edb6be21471d1c3f83b923 (patch) | |
tree | ea5e7582060aa69800c63be7db6ca5f259cc8982 /src/virtualkeyboard/inputcontext.cpp | |
parent | cfa4ab4cbf13971d4b71ee920353822755a3bf31 (diff) |
Add new property InputContext.uppercase
This property is true when either InputContext.shift or
InputContext.capsLock is true.
[ChangeLog] Add new property InputContext.uppercase, which is set to
true when either InputContext.shift or InputContext.capsLock is true
Change-Id: I06ce14c6f626bfe176e6d914e60417ec2009cd5c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/virtualkeyboard/inputcontext.cpp')
-rw-r--r-- | src/virtualkeyboard/inputcontext.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp index 06c95d4d..cc8b9ef8 100644 --- a/src/virtualkeyboard/inputcontext.cpp +++ b/src/virtualkeyboard/inputcontext.cpp @@ -197,6 +197,8 @@ void InputContext::setShift(bool enable) if (d->shift != enable) { d->shift = enable; emit shiftChanged(); + if (!d->capsLock) + emit uppercaseChanged(); } } @@ -212,9 +214,17 @@ void InputContext::setCapsLock(bool enable) if (d->capsLock != enable) { d->capsLock = enable; emit capsLockChanged(); + if (!d->shift) + emit uppercaseChanged(); } } +bool InputContext::uppercase() const +{ + Q_D(const InputContext); + return d->shift || d->capsLock; +} + int InputContext::cursorPosition() const { Q_D(const InputContext); @@ -844,6 +854,20 @@ bool InputContext::filterEvent(const QEvent *event) */ /*! + \qmlproperty bool InputContext::uppercase + \since QtQuick.VirtualKeyboard 2.2 + + This property is \c true when either \l shift or \l capsLock is \c true. +*/ + +/*! + \property QtVirtualKeyboard::InputContext::uppercase + \brief the uppercase status. + + This property is \c true when either \l shift or \l capsLock is \c true. +*/ + +/*! \qmlproperty int InputContext::cursorPosition This property is changed when the cursor position changes. |