Error encountered when trying to display map
-
Hello,
I am currently trying to display a map on the symbian^3 simulator, but i am encountering some errors. What do I do wrong? Thank you!
The code is like this:#include <QtGui/QApplication>
#include <QGeoMappingManager>
#include <QGeoServiceProvider>
#include <QGraphicsGeoMap>QTM_USE_NAMESPACE
int main(int argc, char *argv[])
{QApplication app(argc, argv); QGeoMappingManager *mappingManager = 0; QGeoServiceProvider serviceProvider("nokia"); if (serviceProvider.error() == QGeoServiceProvider::NoError) { mappingManager = serviceProvider.mappingManager(); } QGraphicsGeoMap *map = new QGraphicsGeoMap(mappingManager); map->resize(300, 480); map->show(); return app.exec();
}
The errors are of this type:
( 41753 ) Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages WHERE parentfolderid IN ( SELECT id FROM mailfolders WHERE parentaccountid IN ( SELECT id FROM mailaccounts ))"
Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages WHERE parentfolderid IN ( SELECT id FROM mailfolders WHERE parentaccountid IN ( SELECT id FROM mailaccounts ))"
Could not prepare query "deleteMessages info query"
41753 Unable to removeAccounts - code: 1
( 41753 ) Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages WHERE parentfolderid IN ( SELECT id FROM mailfolders )"
Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages WHERE parentfolderid IN ( SELECT id FROM mailfolders )"
Could not prepare query "deleteMessages info query"
41753 Unable to removeFolders - code: 1
( 41753 ) Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages"
Failed to prepare query; error:"no such column: parentthreadid Unable to execute statement"; statement:"SELECT id,mailfile,parentaccountid,parentfolderid,parentthreadid FROM mailmessages"
Could not prepare query "deleteMessages info query"
41753 Unable to removeMessages - code: 1
( 41753 ) Failed to prepare query; error:"table mailthreads has no column named messagecount Unable to execute statement"; statement:"INSERT INTO mailthreads (messagecount, unreadcount, serveruid, parentaccountid) VALUES(1, 1, '', 24)"
Failed to prepare query; error:"table mailthreads has no column named messagecount Unable to execute statement"; statement:"INSERT INTO mailthreads (messagecount, unreadcount, serveruid, parentaccountid) VALUES(1, 1, '', 24)"
Could not prepare query "addMessage mailthreads insert query"
41753 Unable to addMessages - code: 1 -
Sorry ....
@
#include <QtGui/QApplication>#include "QPushButton"
#include <QGeoMappingManager>
#include <QGeoServiceProvider>
#include <QGraphicsGeoMap>QTM_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication app(argc, argv);QGeoMappingManager *mappingManager = 0;
// QGeoRoutingManager *routingManager = 0;
// QGeoSearchManager *searchManager = 0;QGeoServiceProvider serviceProvider("nokia"); if (serviceProvider.error() == QGeoServiceProvider::NoError) { mappingManager = serviceProvider.mappingManager();
// routingManager = serviceProvider.routingManager();
// searchManager = serviceProvider.searchManager();
}QGraphicsGeoMap *map = new QGraphicsGeoMap(mappingManager); map->resize(300, 480); map->show(); return app.exec();
}
@ -
AFAIK QGraphicsGeoMap is a QGraphicsWidget subclass and should be used in combination with QGraphicsView and friends.
As far as i can see you are not handling the case when loading a service provider fails.
-
Well, i this is just to learn how to manage a map and stuff ... i just took the code from here, the part with Maps and Navigation: http://doc.qt.nokia.com/qtmobility-1.1.3/location-overview.html#maps-and-navigation
-
[quote author="kkrzewniak" date="1310125191"]AFAIK QGraphicsGeoMap is a QGraphicsWidget subclass and should be used in combination with QGraphicsView and friends.
[/quote]You were wright about this ... it had to be done using QGraphicsScene and QGraphicsView. Thank you.
As for the strange error, it seems it only appears if the simulator is closed and it opens, but the application still displays the map.