July 9, 2011

conny conny
Lab Rat
85 posts

Problem with Symbian Qt Components ToolBarButton icons + resource file

 

Hi,

I’m using ToolBarButton with iconSource set to e.g. “toolbar-previous”. If I’m running that file with qmlviewer everything works as expected. However, if I run it from C++ out of a resource file, it looks like it’s trying to load the icon from the same resource file. Of course that fails.

The errors I get are like this one:
file:///home/conny/QtSDK/Simulator/Qt/gcc/imports/com/nokia/symbian/ToolButton.qml:114:5: QML Image: Cannot open: qrc:qml/toolbar-back

To me this looks like a bug. Or am I doing something wrong?

Thanks
Conny

11 replies

July 9, 2011

conny conny
Lab Rat
85 posts

Maybe I should add: qrc:qml/AboutPage.qml is the file that contains the ToolBarButton. So I guess it tried to find the icon relative to this QML file.

July 18, 2011

conny conny
Lab Rat
85 posts

Is anyone using Qt Symbian Components and resource files together without that problem?

July 19, 2011

disperso disperso
Lab Rat
183 posts

I’m not deploying my app yet, so I’m using hardcoded paths till is a prototype, so my resources knowledge is very rusty, but I see something odd: the (pseudo?)-URLs that you are using lack a slash. It should be something like qrc:/qml/AboutPage.qml. This, or you have some URL/path wrong in the resource file or the QML.

Or maybe I’m just sleepy. Will try to give you a better answer tomorrow.

July 19, 2011

conny conny
Lab Rat
85 posts

Hi disperso,

thanks for you answer. I’m curious what happens if you start using resource files as well.

With regards to the paths, you’re right: I’m actually using “qrc:qml/…..” without a leading slash. So far that worked perfectly but maybe together with the Components it creates a problem. I’ll check that.

July 19, 2011

conny conny
Lab Rat
85 posts

Ok, just checked again. In my main.cpp I had:

  1. viewer.setSource(QUrl("qrc:qml/SymbianMainWindow.qml"));

That resulted in following error:

  1. QML Image: Cannot open: qrc:qml/toolbar-back

Then I changed my main.cpp (added a slash):

  1. viewer.setSource(QUrl("qrc:/qml/SymbianMainWindow.qml"));

Now the error contains that slash as well :)

  1. QML Image: Cannot open: qrc:/qml/toolbar-back

To me it looks like the components try to find their resources relative the the root items path. Which is “qrc:/qml/”

Please tell me if you can reproduce this. Thanks!

July 19, 2011

conny conny
Lab Rat
85 posts

I’ve changed the code of the music-player demo to use the predefined icons and it fails as well. I’ve filed a bug about this: http://bugreports.qt.nokia.com/browse/QTCOMPONENTS-915

September 8, 2011

pscanlan pscanlan
Lab Rat
4 posts

Have you added the “toolbar-back” to your “resource” file?. What happens is that the compiler runs through all the files in the “resource” file from top to bottom. If there are errors with the path you will be informed immediately by the compiler output.(right click and expand the error info to see the problem).
I came across the same problem as you when the app was running the graphic resources were not picked up as they were not included in the “resource” file. What I have done is added the whole app into the “qrc” (RESOURCES) file and it worked except for Sounds!! Sounds do not play when added to a resource file.

September 9, 2011

conny conny
Lab Rat
85 posts

Sounds interesting, but I was actually hoping that they released the fix with the latest QtSDK already. But I didn’t check yet. Are you already running the latest SDK?

September 9, 2011

pscanlan pscanlan
Lab Rat
4 posts

Currently Running the latest SDK. I have downloaded the git repositories for the QtMultimediaKit 1.1 to see where in the code their problem lies. Will keep you updated if I manage to find out where. I suspect it is to do with the protocol of the request. For example if it is a standard file then it finds it, but with a “:/” or “qrc:” it does not know what to do.

September 9, 2011

conny conny
Lab Rat
85 posts

Thanks. You also be interested in this one: https://bugreports.qt.nokia.com/browse/QTCOMPONENTS-858

September 9, 2011

pscanlan pscanlan
Lab Rat
4 posts

The link helped. I have found where the problem lies. Now to fix it and test it. Thanks Conny! Will let you know if I succeed.

 
  ‹‹ [SOLVED] Custom NonSattelite PositionSource      Using rotation on a Flickable item ››

You must log in to post a reply. Not a member yet? Register here!