Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9220

Importing of QML files proven to work on Linux and Mac, doesn't on Maemo 5

    XMLWordPrintable

Details

    • macOS

    Description

      This is a bit complex to explain, so bear with me.
      What I'm doing: C++ app that uses QDeclarative* classes to:

      • load an initial [ROOT ITEM].qml (main view of my app, always present)
      • inject/remove from the scene other [ITEMs].qml (views stacked on the top of my main view, and controlled through signals emission)
      • a "bridge" object exposes some C++ calls to the QML space, to allow QML components to do things outside the C++ space.
      • I call QDeclarativeEngine::setBaseUrl() to set the base url.

      Every QML Item is a composition of other smaller items. Those are held in a directory structure like:

      • MainView.qml
      • SecondaryView.qml
      • MainViewComponents/subcomponent1.qml
      • MainViewComponents/subcomponent2.qml
      • MainViewComponents/subsubcomponent1.qml
      • SecondaryViewComponents/subcomponent1.qml
        and so on...

      The Views import their "components" using: "import 'MainViewComponents'"
      Subcomponents do the same with other "sub-subcomponents".

      The QMLs are ALSO imported in a QRC file: in this way there is no need to bring around the files.
      QDeclarativeEngine::setBaseUrl() infact works also with a "qrc:/qmls/". In this way I get the maximum flexibility.

      Problem: when running this kind of stuff on Maemo5, I get messages like "Type [my type] unavailable".
      I tried WITH and WITHOUT the usage of QRC-based URLs. No difference.

      Sorry I can't provide the actual code: I tried to explain as much as possible.
      NOTE: I'm still trying to figure out the cause. I'll try to find an actual solution.

      UPDATE (2010-03-22):
      Seems like the problem was a "chain" of "component unavailable", caused by the fact that the first element to be "unavailalbe" is the WebView.
      Adding a very basic test .QML that shows the problem: webviewtest.qml.
      Try to run it with a:

      1. /opt/qt4-maemo5/bin/qml webviewtest.qml

      result will be:

      file:///home/user/webviewtest.qml:4:1: Type WebView unavailable
      WebView {
      ^
      Wall startup time: 28

      This doesn't happen on other platforms.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            wallison Warwick Allison (closed Nokia identity) (Inactive)
            detro Ivan De Marino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes