QML加载,文件未找到 [英] QML loading , file not found

查看:617
本文介绍了QML加载,文件未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的应用程序为Android。而作为一些成员
建议使用QML的GUI设计我来到了这个问题。
当我在桌面上加载应用程序一切都很好。但问题是,当
将它移植上的Andorid。
这是我的错误:

I am developing app for Android. And as some of members suggested to use QML for gui design I came to this problem. When I load app on desktop everything goes nicely. But problem is when porting it on Andorid. Here is my error:

`W/Qt      ( 1819): file:///data/data/org.kde.necessitas.example.Imenik/files/gui.qml:` 
File not found

和我的code开始QML是:

And my code to start QML is :

QDeclarativeView view; 
     view.setSource(QUrl::fromLocalFile("gui.qml")); 
     view.show(); 

这是我的亲文件:

SOURCES += main.cpp mainwindow.cpp 
HEADERS += mainwindow.h 
FORMS += mainwindow.ui 
QT += \ 
      network \ 
      xml \ 
      declarative 

我真的不知道是哪里的问题可能是。我曾尝试运行它作为桌面应用程序,一切正常nicley。但不能移植它在Android上。

I really don't know where the problem might be. I have tried run it as desktop app and everything works nicley. but cannot port it on android.

推荐答案

可能是你的Q​​ML文件没有被部署在手机上。

Probably your QML file is not deployed on the phone.

添加类似

QML_FILES.source = qml
QML_FILES.target = .
DEPLOYMENTFOLDERS += QML_FILES

# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()

你的.pro文件。确保最后两行是在最后。这适用于Symbian和Harmattan出版社,也许部署是Necessitas有点不同。

to your .pro file. Make sure the last two lines are at the end. This works for Symbian and Harmattan, maybe deployment is a little different with Necessitas.

这篇关于QML加载,文件未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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