Reputation: 21
I am using Qt 5.4 on Mac and my target platform is IOS.
I have a task to add geolocation to my app and I want to use PositioningSource
component.
I added import QtPositioning 5.2
to my QML file and QT += positioning
to my .pro
file and successfully recompiled it. Anyhow I had an error from a header, when the application run.
Have you any ideas on how I can solve this issue? I saw in qmldir file the string plugin declarative_positioning
. There are files libdeclarative_positioning.a
, libdeclarative_positioning.prl
in directory ~/Qt5.4.0/5.4/ios/qml/QtPositioning
.
The same happens when I add import QtLocation 5.2
to my QML, but error message is:
module "QtLocation" plugin "declarative_location" not found
The other standard modules, e.g. QtQuick
, QtQuick.Controls
, imported in the same QML file work fine.
A little example of my qml code:
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtPositioning 5.2 // an error when this string added: "module "QtPositioning" plugin "declarative_positioning" not found"
//import QtLocation 5.2
Rectangle {
id: rect
PositionSource {
id: src
}
Component.onCompleted : console.log(position.coordinate.longitude, " ", src.position.coordinate.latitude)
}
Think, that's ok whith the code and problem is in qt some files or maybe ways. That is 5.4 version, installed from automatic dmg...
Now, I tried Flickr example which using QtPositionnig and it's working fine, but my program still not...
Upvotes: 2
Views: 1203
Reputation: 367
After looking for differences between my project and GeoFlick, I found the problem.
Your *.pro
file should have a line similar to this:
QT += qml quick
For this to work, you would have to add positioning
to that list, and other dependencies you might use. For example, here is what geoflickr.pro
looks like:
QT += qml quick network positioning
Upvotes: 1