如何添加QT资源到Android APK文件? [英] How to add qt resources to android APK file?

查看:960
本文介绍了如何添加QT资源到Android APK文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植小的Qt 应用到的Andr​​oid 。我使用的 Qt Creator的

我有一些图像资源文件。现在的问题是如何将这些文件添加到Android的 APK包的。结果
另一个问题是如何从的Qt ?结果他们访问
我可以使用类似:


  

QIcon则actions_ok = QIcon则(RES_PATH +check.png)?



解决方案

您需要将图像添加到您的资产文件夹,然后访问它们使用以下URI:

 文件:///android_asset/check.png

I'm porting a small Qt application to the Android. I am using Qt Creator.

I have a resource file with some images. The question is how to add these files to the android APK package.
Another question is how to access them from Qt?
Can I use something like:

QIcon actions_ok = QIcon(RES_PATH + "check.png")?

解决方案

You'll need to add the images to your assets folder, and then access them using the following URI:

file:///android_asset/check.png 

这篇关于如何添加QT资源到Android APK文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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