Important: Please read the Qt Code of Conduct -

QtLocation in Qt5 - QML

  • Hi,
    I have problems using the QtLocation module with Qt5 in QML.
    I'm working on a program that worked fine with Qt5-Alpha but doesn't work any more. The "import QtLocation 5.0" statement works, at least it says "read typeinfo files successfully", but if I use QML elements like "Coordinate" or "Map" it says "unknown Component".
    Has the API changed recently? Because all documentation that I could find said that there is a component called Coordinate in this module.
    Some of the official examples have similar problems, though I haven't found one using Coordinate so far.

    But maybe the Module is not installed correctly. I have problems installing other modules (Qt3D, above all), too. I get all the latest modules directly from git and use a standard "qmake && make && make install" to build the modules. This works well for all Qt-Essential modules like qtquick. Do I have to do anything else?
    I'm using QtCreator 2.6.1 and Qt5 in a virtual Fedora Linux.

  • Moderators


    Unfortunately, some modules either lost their maintainers, or their quality was not up to scratch, so they were excluded from the Qt 5.0.0 release. Qt Location did not make the cut, and its code base still requires lots of cleaning up.

    The plan is to include those modules when they are ready though.
    Here’s a list of modules currently accepted in Qt 5.0.0:

  • A lot of the components in Qt Location have been converted to value types. Previously components such as Coordinate, GeoCircle, GeoRectangle etc were QObjects. Now they are value types which provides a much nicer API. I don't think the documentation is published anywhere online. The documentation is available in git, see [1] for documentation on how to use the new coordinate value type.

    The examples in the master branch have also been updated to use the new API. Where did you get the examples from?


Log in to reply