[Solved]QGraphicsGeoMap problem
-
Hi, i used QGraphicsGeoMap in my application for symbian S60 (Qt 4.7.1 and Qt Mobility 1.1beta), and after some manipulations with map (zoom, pan) i get the message in console "[Qt Message] QImage: out of memory, returning null image" and grey images. What to do?
-
i resolved muself: in qgeotiledmapdata.cpp i found next
@
// TODO get this from the engine, which should give different values depending on if this is running on a device or not
d->cache.setMaxCost(10 * 1024 * 1024);
d->zoomCache.setMaxCost(10 * 1024 * 1024);
@EDIT: added code highlight tags (Gerolf)
Please do that next time. Thanks -
I faced a similar problem. The device complained after some zooming that it ran out of memory and apps needed to be closed (BTW: How can this happen if there's a heap limit of 4MB for qt apps by default).
Anyway, the latest qtmobility versions have an #ifdef at the lines mentioned in the previous post and for both caches 510241024 is set under symbian, maemo and friends. This imho gives a total of 10MB cache. So i set a heap of 16MB in the pro file:
TARGET.EPOCHEAPSIZE = 0x20000 0x1000000 // Min 128kb, Max 16Mb
And the problem seems to be solved. Perhaps this should be mentioned in the documentation of qgraphicsgeomap or even better checked at compile time using some magic.