12-13-2012 08:05 AM - edited 12-13-2012 08:57 AM
In order to speed up qml loading, I followed this to compile resources:
https://developer.blackberry.com/cascades/document
Issue:
can't build, with error:
Could not find qmake configuration directoryCould not find qmake configuration fileUsing OS scope before setting MAKEFILE_GENERATORmake[2]: *** No rule to make target `assets.qrc', needed by `o.le-v7-g/.rcc/qrc_assets.cpp'. Stop.
Solution: The tutorial is misleading, the pro file should be :
RESOURCES += qrc-assets.qrcQuestion 1:
Is this a way to hide and protect the source code of qml file? If not , how?
I can still see qml source in .bar file.
Question 2:
I didn't see any effects, do I need to change * to specific file name?
<asset path="assets" dest="assets"> <exclude name="**/*.qml"/> </asset> |
12-13-2012 03:10 PM
I also tried to compile resources, but application fail to start. I saw that error in tutorial too, and i corrected that. You dont need to add this line
<asset path="assets" dest="assets">
<exclude name="**/*.qml"/>
</asset>
to bar-desciptor.xml , insteed you need to modify that line, because you already have it. Just modify this line
"<asset path="assets">assets</asset>" to that above, and you will not get resources inside .bar file anymore.
But something else is missing, application cannot start.
01-15-2013 03:20 AM
I had the same issue. I fixed it by specifying the "qrc:/" prefix when loading my qml.
Change this:
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(th
to this:
QmlDocument *qml = QmlDocument::create("qrc:/assets/main.qml").pare
See: http://supportforums.blackberry.com/t5/Cascades-De
01-15-2013 11:33 PM
I changed to QmlDocument *qml = QmlDocument::create("qrc:/main.qml").parent(this);
But:
slogger2 buffer handle not initialized. ../../lgmon_api.c, logEvent(), around line 578!
bb::cascades::QmlDocument: error when loading QML from: QUrl( "qrc:/main.qml" )
--- errors: (qrc:/main.qml: File not found)
bb::cascades::QmlDocument:createRootObject document is not loaded or has errors, can't create root
01-16-2013 02:27 AM
01-16-2013 08:12 AM - edited 01-16-2013 08:33 AM
01-16-2013 08:17 AM
01-16-2013 08:56 AM
01-16-2013 09:07 AM
I need to manually add each qml file? That's not so smart I think.
Anyway, my qrc file is :
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
<file>assets/main.qml</file>
<file>assets/Common/ToolContainer.qml</file>
<file>assets/Common/ToolItem.qml</file>
<file>assets/Common/ToolPage.qml</file>
...
</qresource>
</RCC>
My xml file has:
<asset path="assets" dest="assets">
<exclude name="**/*.qml"/>
</asset>
My pro file ends with:
RESOURCES += qrc-assets.qrc
DEPENDPATH += assets
And I change
import bb.cascades 1.0
import "Common"
to
import bb.cascades 1.0
import "qrc:/Common"
Still:
bb::cascades::QmlDocument: error when loading QML from: QUrl( "qrc:/assets/main.qml" )
--- errors: (qrc:/assets/main.qml:2:1: "qrc:/Common": no such directory)
bb::cascades::QmlDocument:createRootObject document is not loaded or has errors, can't create root
BTW, should I change
imageSource: "asset:///images/icon_vibro.png"
to
imageSource: "qrc:/asset/images/icon_vibro.png" ?
01-16-2013 09:15 AM