ce1e82a80fbd4af08bf1e7441f0ce7251308f5ac
[toast/confclerk.git] / src / gui / mapwindow.cpp
1 #include "mapwindow.h"
2
3 MapWindow::MapWindow(const QPixmap &aImage, const QString &aName, QWidget *aParent)
4     : QDialog(aParent)
5 {
6     setupUi(this);
7 #ifdef MAEMO
8     showFullScreen();
9     //map->setScaledContents(true);
10     //map->setPixmap(aImage.scaled(QSize(800,480),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation));
11     map->setPixmap(aImage.scaled(QSize(640,480),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation));
12 #elif N810
13     showMaximized();
14     map->setPixmap(aImage.scaled(QSize(400,300),Qt::KeepAspectRatioByExpanding,Qt::SmoothTransformation));
15 #else
16     map->setPixmap(aImage);
17 #endif
18     setMouseTracking(true); // to receive mouse events
19     setWindowTitle(aName);
20 }
21
22 // it is enough to handle mouseReleaseEvent, instead of
23 // getting/creating mouseClikEvent, since the whole window
24 // is occupied by only-one widget/label (image/map)
25 void MapWindow::mouseReleaseEvent(QMouseEvent *event)
26 {
27     Q_UNUSED(event);
28     close();
29 }
30