Hi Carl,

It's known behaviour - whether it counts as a bug or a feature is open to 
discussion :)

The zoom level was made a qreal for when we have vector based map plugins.  At 
the moment the tile based map helper classes - which the current Nokia plugin 
uses - round the zoom level to the nearest integer value.  So at the very least 
it's a bug in the documentation.

At some point in the future we may modify the helper classes to allow 
fractional zoom levels.  The motivation behind that change (if/when it happens) 
would be to allow smooth animations combining pans and zooms, so there would 
probably be some additional API added around the same time to help hint about 
tile prefetching etc... which might be helpful anyhow.

We've got a few things ahead of that in the queue, so it could be quite a while 
before we get around to it.

Cheers,

Dave

> -----Original Message-----
> From: qt-mobility-feedback-boun...@trolltech.com [mailto:qt-mobility-
> feedback-boun...@trolltech.com] On Behalf Of ext Carl Snellman
> Sent: Friday, 12 November 2010 1:12 PM
> To: qt-mobility-feedback@trolltech.com
> Subject: [Qt-mobility-feedback] Map setZoomlevel(qreal) does not work
> 
> Hey,
> 
> I was playing with MapViewer example and noticed that the map
> zoomlevel does not work well if I set the zoomlevel to non-integer
> values. I though it would support say zoomlevel 10.1 as it is
> setZoomlevel(qreal) ......
> 
> A known bug/feature?
> 
> Changes I did:
> >>>>>>>>>>>>>>>
> void MapWidget::wheelEvent(QGraphicsSceneWheelEvent* event)
> {
>     qreal panx = event->pos().x() - size().width() / 2.0;
>     qreal pany = event->pos().y() - size().height() / 2.0;
>     pan(panx, pany);
>     if (event->delta() > 0) { //zoom in
>         if (zoomLevel() < maximumZoomLevel()) {
>             qDebug() << "new zoomlevel:" << zoomLevel() + 0.1;
>             setZoomLevel(zoomLevel() + 0.1);
>         }
>     } else { //zoom out
>         if (zoomLevel() > minimumZoomLevel()) {
>             qDebug() << "new zoomlevel:" << zoomLevel() - 0.1;
>             setZoomLevel(zoomLevel() - 0.1);
>         }
>     }
>     pan(-panx, -pany);
>     event->accept();
> }
> <<<<<<<<<<<<<<<
> 
> Carl
> _______________________________________________
> Qt-mobility-feedback mailing list
> Qt-mobility-feedback@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback

_______________________________________________
Qt-mobility-feedback mailing list
Qt-mobility-feedback@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback

Reply via email to