Qt虚拟键盘自定义样式

时间:2018-02-02 23:01:29

标签: qt qml qtvirtualkeyboard

我需要在小屏幕上为Qt VirtualKeyboard构建自定义样式,以最大限度地提高其可读性。我已经在我的项目中构建了一个自定义布局,并且使用QT_VIRTUALKEYBOARD_LAYOUT_PATH它可以很好地工作。

我遇到的问题是documentation表明自定义样式必须放在Qt目录中。我需要这种风格是可移植的,所以将这种新构建的样式存储在我的本地机器上而不是项目本身是不可接受的。

有没有办法在项目中构建键盘样式?

1 个答案:

答案 0 :(得分:0)

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