本文编译使用qt5.7源码自带虚拟键盘
步骤如下:
1.下载Qt5.7源码
http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.zip
解压
2.找到虚拟键盘源码目录qtvirtualkeyboard,进入该目录,执行如下命令:
a:qmake
CONFIG+="lang-en_GB lang-zh_CN" (qmake在qt的bin目录)
b:make
c:make install
3.调用虚拟键盘
main函数添加 qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));