Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem with Symbian Qt Components ToolBarButton icons + resource file
QtWS25 Last Chance

Problem with Symbian Qt Components ToolBarButton icons + resource file

Scheduled Pinned Locked Moved QML and Qt Quick
12 Posts 3 Posters 5.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    conny
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      conny
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        conny
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • D Offline
          D Offline
          disperso
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            conny
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              conny
              wrote on last edited by
              #6

              Ok, just checked again. In my main.cpp I had:
              @viewer.setSource(QUrl("qrc:qml/SymbianMainWindow.qml"));@

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

              Then I changed my main.cpp (added a slash):
              @viewer.setSource(QUrl("qrc:/qml/SymbianMainWindow.qml"));@

              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!

              1 Reply Last reply
              0
              • C Offline
                C Offline
                conny
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  pscanlan
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    conny
                    wrote on last edited by
                    #9

                    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?

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      pscanlan
                      wrote on last edited by
                      #10

                      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.

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        conny
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          pscanlan
                          wrote on last edited by
                          #12

                          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.

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved