Qt Virtual Keyboard Custom Style

谁说胖子不能爱 提交于 2020-01-21 15:44:30

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/48592098/qt-virtual-keyboard-custom-style

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!