<small id='wwrGH'></small><noframes id='wwrGH'>

  1. <legend id='wwrGH'><style id='wwrGH'><dir id='wwrGH'><q id='wwrGH'></q></dir></style></legend>
    <i id='wwrGH'><tr id='wwrGH'><dt id='wwrGH'><q id='wwrGH'><span id='wwrGH'><b id='wwrGH'><form id='wwrGH'><ins id='wwrGH'></ins><ul id='wwrGH'></ul><sub id='wwrGH'></sub></form><legend id='wwrGH'></legend><bdo id='wwrGH'><pre id='wwrGH'><center id='wwrGH'></center></pre></bdo></b><th id='wwrGH'></th></span></q></dt></tr></i><div id='wwrGH'><tfoot id='wwrGH'></tfoot><dl id='wwrGH'><fieldset id='wwrGH'></fieldset></dl></div>

      • <bdo id='wwrGH'></bdo><ul id='wwrGH'></ul>
      <tfoot id='wwrGH'></tfoot>

      PyQt5/pyqt4 是否已经支持带有手写识别的 QtVirtual

      时间:2023-08-04

      <small id='SAwwB'></small><noframes id='SAwwB'>

          <tbody id='SAwwB'></tbody>

        1. <legend id='SAwwB'><style id='SAwwB'><dir id='SAwwB'><q id='SAwwB'></q></dir></style></legend>
            <i id='SAwwB'><tr id='SAwwB'><dt id='SAwwB'><q id='SAwwB'><span id='SAwwB'><b id='SAwwB'><form id='SAwwB'><ins id='SAwwB'></ins><ul id='SAwwB'></ul><sub id='SAwwB'></sub></form><legend id='SAwwB'></legend><bdo id='SAwwB'><pre id='SAwwB'><center id='SAwwB'></center></pre></bdo></b><th id='SAwwB'></th></span></q></dt></tr></i><div id='SAwwB'><tfoot id='SAwwB'></tfoot><dl id='SAwwB'><fieldset id='SAwwB'></fieldset></dl></div>
            • <bdo id='SAwwB'></bdo><ul id='SAwwB'></ul>
              <tfoot id='SAwwB'></tfoot>
                本文介绍了PyQt5/pyqt4 是否已经支持带有手写识别的 QtVirtualKeyboard?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在使用 pyqt5 开发桌面应用程序,我想使用带有手写识别功能的虚拟键盘.我看到Qt,QtVirtualKeyboard已经支持了.

                这里是

                我得到了在 QtCreator 上运行的 C++ Qt 示例代码.但是使用 python3.5 和 PyQt5 会给出这样的信息:

                模块QtQuick.VirtualKeyboard"未安装导入 QtQuick.VirtualKeyboard 2.1

                我应该如何从这里继续?PyQt5 是否带有 VirtualKeyboard 模块?如果没有,如何在 PyQt5 上安装?

                解决方案

                对于 qt desinger,您只能在 .py 文件中添加这一行.

                os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"

                但是如果你想使用 QML 和 qtvirtualkeyboard;

                pyqt5.8没有虚拟键盘插件,必须使用qt的路径.

                例如,在 ubuntu 上安装 pyqt5、qt5.8 和 qtvirtualkeyboard 的基本步骤:

                1.step 用qtvirtualkeyboard安装qt5.8

                <块引用>

                wgethttp://下载.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run

                chmod +x qt-opensource-linux-x64-5.8.0.run

                ./qt-opensource-linux-x64-5.8.0.run

                2.step

                <块引用>

                apt-get 安装 python3 python3-pippip3 安装 pyqt5

                3.step

                在你的python代码上设置你的qt路径的环境变量.

                导入系统,操作系统os.environ["QT_DIR"] = "/opt/Qt5.8.0/5.8/gcc_64"os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/plugins/platforms"os.environ["QT_PLUGIN_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/plugins"os.environ["QML_IMPORT_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/qml"os.environ["QML2_IMPORT_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/qml"os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"#print(os.environ)从 PyQt5.QtCore 导入 *从 PyQt5 导入 QtCore从 PyQt5.QtWidgets 导入 *从 PyQt5.QtQuick 导入 *类键盘应用程序(对象):def __init__(self):self.view = QQuickView()self.view.setObjectName("视图")#self.view.setFlags(Qt.FramelessWindowHint)self.view.setSource(QUrl("main.qml"))self.view.setResizeMode(QQuickView.SizeRootObjectToView)#self.Screen = self.view.rootObject()#print("屏幕(根) = " + str(self.Screen))self.view.show()应用程序 = QApplication(sys.argv)测试 = 键盘应用程序()sys.exit(app.exec_())

                I'm working on a desktop application using pyqt5, and I want to use a Virtual Keyboard with Handwriting Recognition. I saw that Qt, QtVirtualKeyboard already support it.

                Here's a link!

                I got the C++ Qt example code running on QtCreator. But using python3.5 and PyQt5 it gives this message:

                module "QtQuick.VirtualKeyboard" is not installed 
                 import QtQuick.VirtualKeyboard 2.1 
                

                How should I go on from here? Does PyQt5 comes with VirtualKeyboard module? if no How to install it on PyQt5?

                解决方案

                for qt desinger you can add only this line on your .py file.

                os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
                

                but If you want use QML with qtvirtualkeyboard;

                There is no virtualkeyboard plugin in pyqt5.8, you must be use qt's paths.

                For a example, basic steps for pyqt5, qt5.8 and qtvirtualkeyboard installiation on ubuntu:

                1.step install qt5.8 with qtvirtualkeyboard

                wget http://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run

                chmod +x qt-opensource-linux-x64-5.8.0.run

                ./qt-opensource-linux-x64-5.8.0.run

                2.step

                apt-get install python3 python3-pip pip3 install pyqt5

                3.step

                set environmental variables your qt paths on your python code.

                import sys, os
                os.environ["QT_DIR"] = "/opt/Qt5.8.0/5.8/gcc_64"
                os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/plugins/platforms"
                os.environ["QT_PLUGIN_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/plugins"
                os.environ["QML_IMPORT_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/qml"
                os.environ["QML2_IMPORT_PATH"] = "/opt/Qt5.8.0/5.8/gcc_64/qml"
                os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
                
                #print(os.environ) 
                
                from PyQt5.QtCore import *
                from PyQt5 import QtCore
                from PyQt5.QtWidgets import *
                from PyQt5.QtQuick import *
                
                
                class keyboardapp(object):
                    def __init__(self):
                        self.view = QQuickView()
                        self.view.setObjectName("View")
                        #self.view.setFlags(Qt.FramelessWindowHint)
                        self.view.setSource(QUrl("main.qml"))
                        self.view.setResizeMode(QQuickView.SizeRootObjectToView)
                        #self.Screen = self.view.rootObject()
                        #print("Screen(Root) = " + str(self.Screen))
                        self.view.show()
                
                app = QApplication(sys.argv)
                test = keyboardapp()
                sys.exit(app.exec_())
                

                这篇关于PyQt5/pyqt4 是否已经支持带有手写识别的 QtVirtualKeyboard?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在单独的 QThread 中使用 QTimer 下一篇:根据来自scrapy的信号更新主线程内的PyQt5 Gui

                相关文章

                最新文章

                  <legend id='Xrn7Y'><style id='Xrn7Y'><dir id='Xrn7Y'><q id='Xrn7Y'></q></dir></style></legend>
                  • <bdo id='Xrn7Y'></bdo><ul id='Xrn7Y'></ul>
                    <i id='Xrn7Y'><tr id='Xrn7Y'><dt id='Xrn7Y'><q id='Xrn7Y'><span id='Xrn7Y'><b id='Xrn7Y'><form id='Xrn7Y'><ins id='Xrn7Y'></ins><ul id='Xrn7Y'></ul><sub id='Xrn7Y'></sub></form><legend id='Xrn7Y'></legend><bdo id='Xrn7Y'><pre id='Xrn7Y'><center id='Xrn7Y'></center></pre></bdo></b><th id='Xrn7Y'></th></span></q></dt></tr></i><div id='Xrn7Y'><tfoot id='Xrn7Y'></tfoot><dl id='Xrn7Y'><fieldset id='Xrn7Y'></fieldset></dl></div>

                    <tfoot id='Xrn7Y'></tfoot>

                    <small id='Xrn7Y'></small><noframes id='Xrn7Y'>