C
StyleConstants QML Type
Singleton with keyboard styling constants. More...
Import Statement: | import QtQuick.VirtualKeyboard.Styles |
Inherits: |
Properties
- keyboardDesignHeight : real
- keyboardDesignWidth : real
- keyboardHeight : real
- keyboardKeySize : real
- scaleHint : real
- vkbScreenWidth : int
- wordSuggestionSize : real
Detailed Description
Copy this file to your custom style and modify its properties accrodingly.
The design size specifies the aspect ratio of the virtual keyboard. Styles are scalable according to scaleHint
, which is calculated from the keyboard's actual height and design height.
Note: Some properties in this file are marked as "DO NOT MODIFY". These will be set by the qmltocpp based on values calculated from other dependencies. The compiler currently can't directly resolve scaleHint
and keyboardHeight
as constants in some cases (when used across file), therefore this custom handling by compiler is necessary.
For example, see src/virtualkeyboard/styles/builtin/default/StyleConstants.qml
.
Property Documentation
[read-only] keyboardDesignHeight : real |
The design height of the keyboard.
[read-only] keyboardDesignWidth : real |
The design width of the keyboard.
[read-only] keyboardHeight : real |
The current height of the keyboard.
[read-only] keyboardKeySize : real |
This value is used by the bundled layouts and styles to define a font configuration used by the keyboard keys (KeyPanelDelegate) and registering font.unicodeCoverage for the respective font configuration. The following example demonstrates how to use it in layouts/styles:
readonly property font keysFont: Qt.font({ "pixelSize": StyleConstants.keyboardKeySize * StyleConstants.scaleHint ... })
See also Font Unicode coverage configuration.
[read-only] scaleHint : real |
The keyboard style scale hint. This value is determined by dividing keyboardHeight
by keyboardDesignHeight
. All pixel dimensions must be proportional to this value.
[read-only] vkbScreenWidth : int |
This value is propagated by qmltocpp from MCU.Config.Experimental.vkbScreenWidth. If property was not set, 480 is used by default.
[read-only] wordSuggestionSize : real |
This value is used by the bundled styles to define a font configuration used by SelectionListDelegate. The following example demonstrates how to use it:
readonly property font listFont: Qt.font({ "pixelSize": StyleConstants.wordSuggestionSize * StyleConstants.scaleHint, })
Available under certain Qt licenses.
Find out more.