Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
1.2.0
-
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.