Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Harmattan Qt Components: "import com.nokia.meego 1.0" or "import com.meego 1.0" ?

    QML and Qt Quick
    7
    17
    9294
    Loading More Posts
    • 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.
    • K
      Kypeli last edited by

      The topic might seem weird, but let me explain. I noticed that if I create a new Harmattan projects with Qt Creator (that has the experimental Harmattan target), the default QML pages that were created by the Harmattan target have this

      @import QtQuick 1.1
      import com.meego 1.0@

      But looking at the QmlComponentsGallery, that comes with the N950 and the source code is available online (at "https://qt.gitorious.org/qt-components/qt-components/trees/master/examples/meego/QmlComponentGallery/qml":https://qt.gitorious.org/qt-components/qt-components/trees/master/examples/meego/QmlComponentGallery/qml), you'll notice that they import Qt Components like this

      @import QtQuick 1.1
      import com.nokia.meego 1.0@

      First question would be, which one is the correct one (I guess the second one...)?

      Ok, fine, I change in my Harmattan Qt Components application the import to "import com.nokia.meego 1.0" - but then my app wont run anymore! I use a QList<QObject *> as my ListView model and I get this error

      bq. file:///usr/lib/qt4/imports/com/meego/PageStack.js:144: Error: Cannot assign QObject* to PageStack_QMLTYPE_24*

      My application runs fine, and looks fine, with "import com.meego 1.0" so I wonder which one is correct? Is the latter one a bug, that I cannot use a QList<QObject *> as a list model (which I should be able to do, based on my earlier QML experience).

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • M
        matrixx last edited by

        Hi,
        Didn't think about your error yet, but from those two import clauses, the first one is correct. MeeGo is not Nokia only, that's why com.meego :)

        Nokia Certified Qt Specialist

        1 Reply Last reply Reply Quote 0
        • G
          guoqing last edited by

          it depends on the location of your plugins/qml documents. com.meego is mapped to import/com/meego while com.nokia.meego is mapped to import/com/nokia/meego

          1 Reply Last reply Reply Quote 0
          • K
            Kypeli last edited by

            [quote author="guoqing" date="1312030741"]it depends on the location of your plugins/qml documents. com.meego is mapped to import/com/meego while com.nokia.meego is mapped to import/com/nokia/meego[/quote]

            Yes, this is the QML based detailed answer - this is where QML loads the plugins i.e. Qt Components.

            But this doesn't answer my question from a Harmattan Qt Component's user point of view. Both can be right, depending on the deployment, but there is just one deployment of Harmattan on the device.

            It seems Nokia is using one alternative in their example code and Qt Creator is giving me another one. More interestingly the solution that Nokia is using works worse for me, although their examples run fine on the device.

            Confusing.

            1 Reply Last reply Reply Quote 0
            • A
              awiese2007 last edited by

              I am getting the same error message when changing from "import com.meego 1.0" to "import com.nokia.meego 1.0"...the related lines of code are:

              @ ToolIcon {
              platformIconId: "toolbar-add";
              onClicked: pageStack.push(Qt.resolvedUrl("AddPage.qml"));
              }@

              1 Reply Last reply Reply Quote 0
              • Q
                qgil last edited by

                fwiw I'm using

                @import com.meego 1.0

                ...

                iconId: "toolbar-add"@

                And yes, the hobbyist developer in me is also confused. :)

                1 Reply Last reply Reply Quote 0
                • K
                  Kypeli last edited by

                  FWIW is ended up using only "import com.meego 1.0" and I forgot about this issue altogether. But it's still confusing.

                  I can guess this is related to the fact that the device has an older version of Qt Components (1.0) while we are looking at the source of QmlComponentsGallery that uses a newer version of it (1.1). It would be nice to get a comment from someone who knows what's going on, but I think we just have to wait for the final release of Harmattan SDK and an update for the N950 with Qt Components 1.1.

                  1 Reply Last reply Reply Quote 0
                  • kkoehne
                    kkoehne Moderators last edited by

                    Both com.meego and com.nokia.meego work on the device, and AFAIK there is no difference between them functionality-wise. However, you cannot mix the two namespaces in one application: You have to use just one all over the place, otherwise you get runtime errors. (The problem seems to be that both directories contain a copy of the same C++ library, while only one library can be loaded at runtime.)

                    In the end we settled on com.nokia.meego, and I fixed the wizard for Qt Creator 2.3 accordingly. I'm sorry for the confusion, I personally learned about the com.nokia.meego namespace just a few days ago.

                    Director R&D, The Qt Company

                    1 Reply Last reply Reply Quote 0
                    • Q
                      qgil last edited by

                      So... for those of us developing Harmattan apps as we speak: should we move to

                      @import com.nokia.meego 1.0@

                      in order to be on the safe side?

                      1 Reply Last reply Reply Quote 0
                      • kkoehne
                        kkoehne Moderators last edited by

                        Yes, I suggest using "com.nokia.meego 1.0" all over the place.

                        Director R&D, The Qt Company

                        1 Reply Last reply Reply Quote 0
                        • A
                          awiese2007 last edited by

                          But "com.nokia.meego 1.0" still gives the error the op and others experience...would be nice to get this issue solved before recommending folks moving to it...

                          1 Reply Last reply Reply Quote 0
                          • kkoehne
                            kkoehne Moderators last edited by

                            awiese2007, please make sure that you've really no import 'com.meego 1.0' any more in any .qml file used by your application (might also be qml import libraries). If the error is still there, please file a bug report with enough details to reproduce it.

                            Director R&D, The Qt Company

                            1 Reply Last reply Reply Quote 0
                            • Q
                              qgil last edited by

                              "Change to com.nokia.meego made":https://gitorious.org/miniature/miniature/commit/4b04d58042935286ecca146b98fe830fcec61907 and indeed everything seems to work just like before. Thanks!

                              1 Reply Last reply Reply Quote 0
                              • K
                                Kypeli last edited by

                                I get the following error if I use com.nokia.meego 1.0 as stated in my original post.

                                file:///usr/lib/qt4/imports/com/meego/PageStack.js:144: Error: Cannot assign QObject* to PageStack_QMLTYPE_24*

                                That one import line is the only change I do to trigger this. Any ideas why this would happen?

                                1 Reply Last reply Reply Quote 0
                                • kkoehne
                                  kkoehne Moderators last edited by

                                  @Kypeli, I guess you use "com.meego 1.0" somewhere in your application, too. If you define the QML_IMPORT_TRACE environment variable before launching the application you should be able to see that.

                                  Director R&D, The Qt Company

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    muthu005 last edited by

                                    if i import com.nokia.meego 1.0, i am getting error "Package not found". what shall i do?

                                    1 Reply Last reply Reply Quote 0
                                    • kkoehne
                                      kkoehne Moderators last edited by

                                      WHen do you get the error? When running your app on the device, or in the Simulator? In case it's the latter, check that 'com.nokia.extras platform' is set to 'Harmattan' in the Simulator settings.

                                      Director R&D, The Qt Company

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post