Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error encountered when trying to display map
QtWS25 Last Chance

Error encountered when trying to display map

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 3.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.
  • G Offline
    G Offline
    goosebumps4
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Please embrace your code in the post with the character '@' . Otherwise nobody can read it.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goosebumps4
        wrote on last edited by
        #3

        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();
        

        }
        @

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kkrzewniak
          wrote on last edited by
          #4

          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.

          Me, Grimlock, not "nice dino". ME BASH BRAINS!

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goosebumps4
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goosebumps4
              wrote on last edited by
              #6

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

              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