Pyside + QtMobility Location module on maemo SDK [solved]
I'm using pyside to play around with the location module in the maemo SDK. unfortunately I don't get what I want. :)
I did install from extra-devel the following packages:
the problem occurs when in the program I try to create the QGeoServiceProvider in order to start the QGraphicsGeoMap.
@ def __init__my_map(self):
self.my_service_provider = Location.QGeoServiceProvider("nokia")
self.my_mapping_manager = self.my_service_provider.mappingManager()
self.my_mapview = Location.QGraphicsGeoMap (self.my_mapping_manager, self)
Anyway this is the error message:
@self.my_service_provider = Location.QGeoServiceProvider("nokia")@
I did a @print dir(Location)@ and here is the result:
@['QGeoAreaMonitor', 'QGeoCoordinate', 'QGeoPositionInfo', 'QGeoPositionInfoSource', 'QGeoSatelliteInfo', 'QGeoSatelliteInfoSource', 'QNmeaPositionInfoSource', '_Cpp_Api', 'doc', 'file', 'name']@
it seems that pyside is not aware of everything that the location module knows... I'm sure I have QtMobility 1.2 because I could execute the QML mapviewer demo without any problem.
I've noticed that the pyside Qtmobility documentation refers to a version 0.2.2. Does everyone know if may be my problem is related to the fact that pyside is only at the vesion 0.2.0?
If "Yes" I think I have just to wait until the new version is released... if "no" is there a way to force pyside to connect to the qtmobility 1.2?
Thank you very much... have a nice weekend
renato.filho last edited by
Could you report this on pyside bugzilla, we will check during the next week. Thanks
Thanks for your reply... I didn't have time yesterday to fill the bug. I will play again with python tomorrow afternoon and fill a detail bug with what I did discover (I did try more to solve the issue and discovered something else..)
I wasn't expecting to find a bug, I was more considering a wrong configuration from my side :)
Have a nice day
just for info, here is the bug report link
I've just noticed that in the first post I missed actually the error message :) sorry, here it is:
@self.my_service_provider = Location.QGeoServiceProvider("nokia")
AttributeError: 'module' object has no attribute 'QGeoServiceProvider'@
And just for info here the error message that I receive while trying to load QtMobility 1.2 pugling within QDeclarativeView (instruction taken from "this link":http://www.developer.nokia.com/Community/Wiki/Latest_Qt_and_Qt_mobility_evaluation_on_Maemo
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setWindowTitle("test QML") self.engine().addImportPath('/opt/qtm12/imports') self.engine().addPluginPath('/opt/qtm12/plugins') self.setSource(QtCore.QUrl.fromLocalFile('qml/maemodrive/mapviewer.qml'))@
the error is while loading the modules:
plugin cannot be loaded for module "QtMobility.location": Cannot load library
undefined symbol: _ZNK10QtMobility13QGeoMapObject10metaObjectEv)
import QtMobility.location 1.2
a detailed description is given into the bugreport.
I have a couple of question that maybe you can help me with:
I've been trying this also on the N900 available on the "remote device access" service from Nokia with the same result. The location module is reduced. Reading in the net I did discover that in N900 the QtMobility 1.2 is installed in parallel to the original given by nokia (1.0.2) That's why I guess pyside doesn't connect to the 1.2 version of qtmobility but to the official one.
In maemo forum they said that you need something like
@LD_LIBRARY_PATH=/opt/qtm12/lib yourexecutable@ to point to the new libraries. So my questions are:
Do you know a method there I can check the QtMobility version with pyside? Something like:
but that will return QtMobility instead of QtCore version?
In case it points to the official QtMobility release, is there a way to change this? Using
@LD_LIBRARY_PATH=/opt/qtm12/lib python2.5@ didn't work :(
Thanks a lot for your help
I think I did find a partial solution.
the nokia N900 has QtMobility 1.0.2 officially installed with the PR1.3 update. Through the pachages libqtm-11-dev or libqtm-12-dev is it possible to install the QtMobility 1.1 or 1.2. These libraries are installed in parallel to the official one, that's why the official python-qtmobility package is linked to the 1.0.2 version.
In maemo extras-devel I found another package:
these are the python libraries linked to the non official QtMobility 1.1 and as well can be installed in parallel to the official one. Infact the have been saved in:
I did create a symbolic link to these libraries in the officialfolder in which python is looking for:
ln -s /opt/qtm11/lib/python2.5/site-packages/QtMobility/ ./QtMobility11@
In these way I can access the QtMObility 1.1 from python:
@[sbox-FREMANTLE_X86: ~] > run-standalone.sh python2.5
Python 2.5.4 (r254:67916, May 17 2010, 21:11:14)
[GCC 4.2.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from QtMobility11 import Location
print dir (Location)
['QGeoAddress', 'QGeoAreaMonitor', 'QGeoBoundingArea', 'QGeoBoundingBox',
'QGeoBoundingCircle', 'QGeoCoordinate', 'QGeoManeuver', 'QGeoMapCircleObject',
'QGeoMapData', 'QGeoMapGroupObject', 'QGeoMapObject', 'QGeoMapObjectInfo',
'QLandmarkRemoveRequest', 'QLandmarkSaveRequest', 'QLandmarkSortOrder',
'QLandmarkUnionFilter', 'QNmeaPositionInfoSource', '_Cpp_Api', 'doc', 'file', 'name']@
As you can see there is now access to all the Location classes from QtMobility 1.1
Hope this can help in case you encounter similar trouble, and hope somewhen also a package for the 1.2 version appears... unfortunately I'm not able to do it myself :)