简体   繁体   English

如何将 qtvirtualkeyboard 添加到 qt 小部件项目

[英]how to add qtvirtualkeyboard to a qt widget project

I have a Qt Widget project that I created using QtCreator and Qt version 5.15.2 to which I'm trying to add the QtVirtualKeyboard as matchbox-keyboard I've already tried using stays under the application when it's in fullscreen mode.我有一个使用 QtCreator 和 Qt 版本 5.15.2 创建的 Qt Widget 项目,我正在尝试将 QtVirtualKeyboard 添加为 matchbox-keyboard 我已经尝试在应用程序处于全屏模式时使用停留在应用程序下。

However I'm having trouble getting it to work as it's not appearing at all at the moment.但是我无法让它工作,因为它目前根本没有出现。 This is how I've tried adding it这就是我尝试添加它的方式

Main.cpp主文件

#include "mainwindow.h"

#include <QApplication>
#include <QtWidgets>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    MainWindow w;
    //w.showFullScreen();
    w.show();
    return a.exec();
}

I've tried adding QT += qtvirtualkeyboard or QT += virtualkeyboard in the.pro file but it just gives me an error saying "unknown module"我尝试在.pro文件中添加QT += qtvirtualkeyboardQT += virtualkeyboard但它只是给我一个错误说“未知模块”

How can I add the virtual keyboard to the project?如何将虚拟键盘添加到项目中?

You will need to make sure that the QtVirtualKeyboard library is selected during the installation process.您需要确保在安装过程中选择了 QtVirtualKeyboard 库。

Also, I would recommend you that you start using cmake for Qt applications as Qt has officially dropped qmake since the release of Qt 6.另外,我建议您开始将 cmake 用于 ZE8801102A40AD89DDCFDCAEBF008D25Z 应用程序,因为 Qt 自 ZE8801102A40AD25ZDDCAF8 发布以来已正式放弃 qmake。

It is not to say that you cannot use it, but you will get better support and results by using an actively developed build system rather than an abandoned.并不是说你不能使用它,而是使用积极开发的构建系统而不是废弃的构建系统,你会得到更好的支持和结果。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM