[SOLVED]QtMobility in QML
-
I spent some time now trying to figure out the logic in utilizing QtMobility in QML code.
Issue is:- I have final SDK version installed "by default"
- once I add the line "import QtMobility.location 1.1" the app simply fails to run in QML Viewer with error "module "QtMobility.location" is not installed"
I thought the SDK is like "ready-to-go" but it seems it needs some manual setting up in order to make it QtMobility ready?
I read some stuff here: "Qt Mobility Installation Guide":http://doc.qt.nokia.com/qtmobility-1.2/installation.html
So do I really need to have all those ActionPerl etc installed on my Windows PC in order to make the module work?
User Journey is really weird in this case;(
SOLUTION:
- just add: import QtMobility.location 1.1 into the beginning of your qml
- add to pro file (you will see commented reference there):
CONFIG += mobility
MOBILITY += location - now re-build the project (q-make)
This works for Simulator only, seems like desktop emulator is not meant to be supporting Qt Mobility.
-
I had a similar problem earlier. Did you start it as a QML project?
If you did, have a look in your project file (*.qmlproject). If it has the line "import QmlProject 1.0" change it to "import QmlProject 1.1"
Let me know if that works.
-
Hey thank for your reply.
I am currently working in Qt Quick UI project (not an app) - maybe that's the reason?I tried to do as suggested straghtforwardly changing the version to 1.1 as you mentioned above - the project fails to load with the following messages:
c:/qtsdk/symbian/sdks/symbian1qt473/mkspecs/symbian-abld/qmake.conf(8): 'option' is not a recognized test function
c:/qtsdk/symbian/sdks/symbian3qt473/mkspecs/symbian-sbsv2/qmake.conf(8): 'option' is not a recognized test function
Error while loading project file!
file:///C:/Project/TestProject1/TestProjectMain.qmlproject:3 module "QmlProject" version 1.1 is not installedError while loading project file!
file:///C:/Project/TestProject1/TestProjectMain.qmlproject:3 module "QmlProject" version 1.1 is not installedError while loading project file!
file:///C:/Project/TestProject1/TestProjectMain.qmlproject:3 module "QmlProject" version 1.1 is not installed -
Hmm, On further investigation the "fix" i suggested is only needed if you're running Qt Creator 2.2 with the Qt SDK 1.1 . As I assume you're using the Creator version that came with the SDK you will need to change it back.
Sorry for the confusion.
-
Hmm but if I am not targetting to release the app in nearest 3-4 months - maybe it makes sense for me to switch to 2.2??:)
-
I have installed 2.2 - basically same issue - module not found.
So I bet I still need to do everything listed in the installation guide.Question that I have is - is it realistic to achieve working with QMLviewer and QtMobility elements?
-
me too facing the same problem. i am getting "QtMobility.location" not installed, but i have followed all the steps given in installation guide.
-
cmer4's solution worked for me. Mobility doesn't seem to work in the desktop mode (it's not mobile, go figure), but it works perfect when I build for Android.
I bet there is a way to make Mobility work for desktop though...