Uploaded image for project: 'Qt Mobility'
  1. Qt Mobility
  2. QTMOBILITY-1669

calling QGraphicsGeoMap::fitInViewport() too early results in wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 1.2.0
    • Location
    • None

    Description

      If I create a QGraphicsGeoMap and then right away call map->finInViewPort(myBoundingBox) it results in the map either beeing wrongly zoomed, wrongly positioned or both. Chances that fitInViewport does what it is supposed to are very low. It seems like if the fitInViewport() call actually works, but after that something resets the map to its initial position (North Pole) and/or zoom level (lowest) depending on the actual CPU load.

      If I delay the fitInViewport call by e.g. 500ms using a singleshot timer it works as expected. This is not really a solution because the 500ms might be a good guess for a desktop CPU but for example on the N900 this isn't enough. It would require to delay the call ba 1.5 seconds.

      Attached you can find a sample project that adds a MapObject and calls fitInViewport(obj->boundingBox()). mainwindow.cpp:39 does the fitInViewport right away and does not work, mainwindow.cpp:40 uses the single shot timer which works fine.

      This issue is also reproducable with earlier versions of QtMobility.

      Attachments

        1. fitInViewport_example.tar.gz
          4 kB
          Michael Zanetti
        2. map-precision-fix.diff
          2 kB
          Pyry Jahkola

        Activity

          People

            alewilso Alex Wilson (closed Nokia identity) (Inactive)
            mzanetti Michael Zanetti
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: