Qt 虚拟键盘自定义样式 [英] Qt Virtual Keyboard Custom Style

查看:28
本文介绍了Qt 虚拟键盘自定义样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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?

推荐答案

不一定要在Qt目录下,只要在QtQuick/VirtualKeyboard/Styles/下的目录下即可在 QML 导入路径中.

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.

以自动测试为例:

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

您也可以将样式放在该文件夹结构下的 .qrc 文件中:

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

我创建了一个任务来使这一点更清楚:https://bugreports.qt.io/browse/QTBUG-66172

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

这篇关于Qt 虚拟键盘自定义样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆