How to custom qml virtual keyboard ?
-
-
@small_bird
last time...
engine->addImportPath(":/kbstyles")
-
@raven-worx Does not work, thanks all the same!
-
@small_bird
if you follow the instructions in my post it definitely works, i used it myself already.
If not you are still doing something wrong.
Only advice left i can give is try a full rebuild (clean, rerun qmake, build again) -
@raven-worx
Warning:。。。。。。 -
The problem may be in the order of the addImportPath and engine.load actions. I found that
engine.load(QUrl("qrc:/main.qml"));
must be executed only after
engine.addImportPath("qrc:/kbstyles"); qputenv("QT_VIRTUALKEYBOARD_STYLE", "mykbstl");
So the code must be something like this:
QQmlApplicationEngine engine; engine.addImportPath("qrc:/kbstyles"); qputenv("QT_VIRTUALKEYBOARD_STYLE", "mykbstl"); engine.load(QUrl("qrc:/main.qml"));
-
Thank u for this thread. I resolved my problem with ru_RU <3
-
@priyankar maybe my answer in this topic helps you:
https://forum.qt.io/topic/134990/customising-qt-virtual-keyboard-qml-for-a-cross-compiled-remote-device/3 -
@small_bird can you share how you resolved I'm facing same issue
-
The correct path for styles is actually not just QtQuick/VirtualKeyboard/Styles.
In the documentation it states it is: $$[QT_INSTALL_QML]/QtQuick/VirtualKeyboard/Styles.
If the path to QtQuick/VirtualKeyboard/Styles is qrc:/kbstyles as above then to include the [QT_INSTALL_QML] portion for QML >= 2.0.0 put in main.cpp:
qputenv("QML2_IMPORT_PATH", "qrc:/kbstyles")The code should look similar to this:
QQmlApplicationEngine engine;
qputenv("QML2_IMPORT_PATH", "qrc:/kbstyles");engine.addImportPath("qrc:/kbstyles");
qputenv("QT_VIRTUALKEYBOARD_STYLE", "keyboardStyle");qputenv("QT_VIRTUALKEYBOARD_LAYOUT_PATH",
"qrc:/kbstyles/QtQuick/VirtualKeyboard/layouts");engine.load(QUrl("qrc:/main.qml"));
-