July 30, 2011

Kypeli Kypeli
Lab Rat
41 posts

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

Page  
1

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

  1. import QtQuick 1.1
  2. 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 [qt.gitorious.org]), you’ll notice that they import Qt Components like this

  1. import QtQuick 1.1
  2. 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

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?

16 replies

July 30, 2011

matrixx matrixx
Lab Rat
50 posts

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

 Signature 

Nokia Certified Qt Specialist

July 30, 2011

guoqing guoqing
Lab Rat
5 posts

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

July 30, 2011

Kypeli Kypeli
Lab Rat
41 posts
guoqing wrote:
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

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.

August 19, 2011

awiese2007 awiese2007
Lab Rat
7 posts

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:

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

August 19, 2011

qgil qgil
Ant Farmer
86 posts

fwiw I’m using

  1. import com.meego 1.0
  2.  
  3. ...
  4.  
  5. iconId: "toolbar-add"

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

August 19, 2011

Kypeli Kypeli
Lab Rat
41 posts

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.

August 22, 2011

kkoehne kkoehne
Ant Farmer
61 posts

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.

August 23, 2011

qgil qgil
Ant Farmer
86 posts

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

  1. import com.nokia.meego 1.0

in order to be on the safe side?

August 23, 2011

kkoehne kkoehne
Ant Farmer
61 posts

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

August 23, 2011

awiese2007 awiese2007
Lab Rat
7 posts

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…

August 23, 2011

kkoehne kkoehne
Ant Farmer
61 posts

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.

August 23, 2011

qgil qgil
Ant Farmer
86 posts

Change to com.nokia.meego made [gitorious.org] and indeed everything seems to work just like before. Thanks!

September 1, 2011

Kypeli Kypeli
Lab Rat
41 posts

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?

September 1, 2011

kkoehne kkoehne
Ant Farmer
61 posts

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

December 23, 2011

muthu005 muthu005
Lab Rat
17 posts

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

Page  
1

  ‹‹ [SOLVE]Quiting Problem      How to add "fast scroll" to ListView with Harmattan Qt Components? ››

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