QML Virtual keyboard, KeyboardLayout, BaseKey BaseKey.qml:193: ReferenceError: keyboard is not defined
-
Hi. I have encounter with referenceError when use KeyboardLayout with Key.
error BaseKey.qml:193: ReferenceError: keyboard is not defined
For any help will be thankful.
code:import QtQuick 2.7 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.2 import QtQuick.VirtualKeyboard 2.1 Item {
KeyboardLayout { keyWeight: 160 KeyboardRow { Key { key: Qt.Key_Q text: "q" } Key { key: Qt.Key_W text: "w" //keyWeight: 200 } } }
}
-
I didn't read carefully documentation and as a result i have this question, what ones should do is :
1. copy the existing layout files from QTDIR/qtvirtualkeyboard/src/virtualkeyboard/content/layouts/en_GB 2. adapt to your needs 3. add the files in a (custom) path (e.g. :/path/to/my/layouts/en_GB) to your qrc in the beginning of your main() add: qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); qputenv("QT_VIRTUALKEYBOARD_LAYOUT_PATH", ":/path/to/my/kb/layouts");