Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Error encountered when trying to display map

    Mobile and Embedded
    3
    6
    2778
    Loading More Posts
    • 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
      goosebumps4 last edited by

      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 Reply Quote 0
      • K
        koahnig last edited by

        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 Reply Quote 0
        • G
          goosebumps4 last edited by

          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 Reply Quote 0
          • K
            kkrzewniak last edited by

            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 Reply Quote 0
            • G
              goosebumps4 last edited by

              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 Reply Quote 0
              • G
                goosebumps4 last edited by

                [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 Reply Quote 0
                • First post
                  Last post