Important: Please read the Qt Code of Conduct -

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?


  • 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.

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

  • 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.

  • 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.

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

    That resulted in following error:
    @QML Image: Cannot open: qrc:qml/toolbar-back@

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

    Now the error contains that slash as well :)
    @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!

  • 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:

  • 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.

  • 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?

  • 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.

  • Thanks. You also be interested in this one:

  • 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.

Log in to reply