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. [SOLVED]QtMobility in QML
QtWS25 Last Chance

[SOLVED]QtMobility in QML

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 6.0k 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
    cmer4
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • kidproquoK Offline
      kidproquoK Offline
      kidproquo
      wrote on last edited by
      #2

      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.

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

        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 installed

        Error while loading project file!
        file:///C:/Project/TestProject1/TestProjectMain.qmlproject:3 module "QmlProject" version 1.1 is not installed

        Error while loading project file!
        file:///C:/Project/TestProject1/TestProjectMain.qmlproject:3 module "QmlProject" version 1.1 is not installed

        1 Reply Last reply
        0
        • kidproquoK Offline
          kidproquoK Offline
          kidproquo
          wrote on last edited by
          #4

          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.

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

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

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

              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?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                muthu005
                wrote on last edited by
                #7

                me too facing the same problem. i am getting "QtMobility.location" not installed, but i have followed all the steps given in installation guide.

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  trusktr
                  wrote on last edited by
                  #8

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

                  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