Search code examples
qtqmlqtvirtualkeyboard

Qt Virtual Keyboard Custom Style


I need to build a custom Style for a Qt VirtualKeyboard on a small screen to maximize its readability. I have built a custom layout into my project, and using the QT_VIRTUALKEYBOARD_LAYOUT_PATH it works great.

The problem I am having is that the documentation states that the custom style must be placed in the Qt Directory. I need this style to be portable, however, so storing this newly built style on my local machine, rather than in the project itself, will not be acceptable.

Is there any way to build a use a keyboard style within a project?


Solution

  • It doesn't have to be in the Qt directory, just in a directory that is under QtQuick/VirtualKeyboard/Styles/ and in the QML import path.

    As an example, take a look at the auto test:

    http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/tests/auto/styles/data

    You can also put the style in a .qrc file under that folder structure:

    http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/virtualkeyboardsettings.cpp#n70

    I've created a task to make this clearer: https://bugreports.qt.io/browse/QTBUG-66172