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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: Location
    • Labels:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes