From adabc870bc1e60bb57edb6be21471d1c3f83b923 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Wed, 23 Nov 2016 21:56:56 +0200 Subject: 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 --- src/virtualkeyboard/inputcontext.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/virtualkeyboard/inputcontext.cpp') 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); @@ -843,6 +853,20 @@ bool InputContext::filterEvent(const QEvent *event) This property is changed when the caps lock status changes. */ +/*! + \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 -- cgit v1.2.3