2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Sami Rämö - sami.ramo@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26 #include <QMouseEvent>
29 #include "mapengine.h"
31 MapView::MapView(QWidget *parent) : QGraphicsView(parent)
33 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
34 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
37 void MapView::setZoomLevel(int zoomLevel)
39 double scaleFactor = pow(2, zoomLevel - MapEngine::MAX_ZOOM_LEVEL);
40 scale(scaleFactor, scaleFactor);
43 void MapView::mousePressEvent(QMouseEvent *event)
45 qDebug() << __PRETTY_FUNCTION__ << "scene coordinate:" << mapToScene(event->pos());