source: src/gui/mapwindow.cpp @ 02c1e09

qt5
Last change on this file since 02c1e09 was 02c1e09, checked in by pavelpa <pavelpa@…>, 12 years ago

diplayed map is closed by single-click, instead of double-click

  • Property mode set to 100644
File size: 525 bytes
Line 
1#include "mapwindow.h"
2
3MapWindow::MapWindow(const QPixmap &aImage, const QString &aName, QWidget *aParent)
4    : QDialog(aParent)
5{
6    setupUi(this);
7    setMouseTracking(true); // to receive mouse events
8    setWindowTitle(aName);
9    map->setPixmap(aImage);
10}
11
12// it is enough to handle mouseReleaseEvent, instead of
13// getting/creating mouseClikEvent, since the whole window
14// is occupied by only-one widget/label (image/map)
15void MapWindow::mouseReleaseEvent(QMouseEvent *event)
16{
17    Q_UNUSED(event);
18    close();
19}
20
Note: See TracBrowser for help on using the repository browser.