简体   繁体   English

Android上的PyQt

[英]PyQt on Android

I'm working on PyQt now, and I have to create the application on Android, I've seen the kivy library, but it's too crude. 我现在正在使用PyQt,并且必须在Android上创建应用程序,我已经看到了kivy库,但是它太粗糙了。

Is there any way now to run an application on Android made on PyQt? 现在有什么方法可以在PyQt上的Android上运行应用程序吗?

With the tool pyqtdeploy you can deploy a PyQt5 app to: 使用pyqtdeploy工具,您可以将PyQt5应用程序部署到:

  • Windows 视窗
  • GNU/Linux GNU / Linux
  • Mac OS X Mac OS X
  • Android 安卓系统
  • iOS 的iOS

Click here to see pyqtdeploy's documentation . 单击此处查看pyqtdeploy的文档 It is a GUI tool that will package your PyQt5 application and compile it for the target platform. 它是一个GUI工具,它将打包您的PyQt5应用程序并针对目标平台进行编译。

pyqtdeploy gui

It lets you select various Qt modules to include in the compilation: 它允许您选择各种Qt模块以包括在编译中:

pyqtdeploy模块

On the command-line you would use the pyqtdeploy-build command like this: 在命令行上,您将使用pyqtdeploy-build命令,如下所示:

pyqtdeploy-build pyqt-demo.pdy

Back in June 2016, there was a mailing list message that indicated that pyqtdeploy works . 早在2016年6月, 就有一封邮件列表消息表明pyqtdeploy可以运行 It's 2018 as I'm writing this so I assume pyqtdeploy has matured; 我写这篇文章的时候是2018年,所以我认为pyqtdeploy已经成熟; the latest package version is 2.0.1 which was released on 5 January 2018. 最新的软件包版本是2.0.1,已于2018年1月5日发布。

Android does not support pyQt4. Android不支持pyQt4。 PyQt5 is however supported(read this: https://groups.google.com/forum/#!topic/android-scripting/HUbyuYnm3Z8 ). 但是支持PyQt5(阅读: https ://groups.google.com/forum/#!topic/android-scripting/HUbyuYnm3Z8)。 However, you could port you application to use PySide( https://pypi.python.org/pypi/PySide ). 但是,您可以移植应用程序以使用PySide( https://pypi.python.org/pypi/PySide )。 It provides bindings for the Qt4 platform. 它为Qt4平台提供绑定。 You can then use pyside-android( http://thp.io/2011/pyside-android/ ). 然后,您可以使用pyside-android( http://thp.io/2011/pyside-android/ )。

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

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