diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-08-17 22:46:50 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-08-18 06:54:30 +0000 |
commit | 5eae254a7dd784349e8d5fdf07881644e0dd4dc5 (patch) | |
tree | 9be949a9f771763b04cb301bb7a9d9c737e476a8 /src | |
parent | 530b7cb114ccbc0567b2c279492b6dfd980dcec0 (diff) |
Fix QML warning propagated from BaseKey in a specific use case
If the Key.alternativeKeys are assigned like:
Key {
alternativeKeys: condition ? "abc" : "def"
}
it will cause the following QML warning from BaseKey:
[...]/BaseKey.qml:82:32: Unable to assign [undefined] to QString
It seems to be caused by the order in which the dependent
properties effectiveAlternativeKeysHighlightIndex and
effectiveAlternativeKeys are updated.
This change fixes the issue by adding the effectiveAlternativeKeys
as condition for the property assignment.
Change-Id: I0225a95a60920201161c7d8c084667c57c1c29d4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/virtualkeyboard/content/components/BaseKey.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/virtualkeyboard/content/components/BaseKey.qml b/src/virtualkeyboard/content/components/BaseKey.qml index 5c686adf..ae3b530f 100644 --- a/src/virtualkeyboard/content/components/BaseKey.qml +++ b/src/virtualkeyboard/content/components/BaseKey.qml @@ -79,7 +79,7 @@ Item { The default value based on the default item in the effective alternative keys. */ - property string smallText: effectiveAlternativeKeysHighlightIndex !== -1 ? effectiveAlternativeKeys[effectiveAlternativeKeysHighlightIndex] : "" + property string smallText: effectiveAlternativeKeys && effectiveAlternativeKeysHighlightIndex !== -1 ? effectiveAlternativeKeys[effectiveAlternativeKeysHighlightIndex] : "" /*! \since QtQuick.VirtualKeyboard 2.0 |