diff options
author | Stijn Buys <ingar@telenet.be> | 2020-07-16 18:12:47 +0200 |
---|---|---|
committer | Stijn Buys <ingar@telenet.be> | 2020-07-16 18:12:47 +0200 |
commit | eda02d2c1f898e4c02ccd2317973c2b8463a7037 (patch) | |
tree | 9e1c593c2f052d1dd2ba24fd8daab6b0fc73aec6 /src | |
parent | 1d4e93e3bd49c0b93eca7696092ee8b356bd6cae (diff) |
Diffstat (limited to 'src')
-rw-r--r-- | src/editorwindow.cc | 5 | ||||
-rw-r--r-- | src/mainwindow.cc | 4 | ||||
-rw-r--r-- | src/mainwindow.h | 11 | ||||
-rw-r--r-- | src/mapwidget.cc | 8 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/editorwindow.cc b/src/editorwindow.cc index 29f2c1f..00ff0fd 100644 --- a/src/editorwindow.cc +++ b/src/editorwindow.cc @@ -11,11 +11,14 @@ #include "mapwidget.h" #include "sidebar.h" -#include <QtGui> #include <QFile> #include <QSplitter> #include <QTextStream> #include <QDebug> + +#include <QtGui> +#include <QApplication> +#include <QMessageBox> namespace editor { diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 6aaf48a..31bcf60 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -10,6 +10,10 @@ #include "config.h" +#include <QMenuBar> +#include <QStatusBar> +#include <QFileDialog> + namespace editor { diff --git a/src/mainwindow.h b/src/mainwindow.h index 4bf2ffb..66c63c2 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -9,12 +9,11 @@ #define __INCLUDED_EDITOR_MAINWINDOW__ #include <QtGui> - #include <QMainWindow> - -class QAction; -class QMenu; -class QMdiArea; +#include <QMdiSubWindow> +#include <QAction> +#include <QMenu> +#include <QMdiArea> namespace editor { @@ -71,4 +70,4 @@ private: } -#endif // __INCLUDED_EDITOR_MAINWINDOW__
\ No newline at end of file +#endif // __INCLUDED_EDITOR_MAINWINDOW__ diff --git a/src/mapwidget.cc b/src/mapwidget.cc index b5f52d1..ba00799 100644 --- a/src/mapwidget.cc +++ b/src/mapwidget.cc @@ -47,11 +47,13 @@ float MapWidget::zoom() const void MapWidget::wheelEvent(QWheelEvent *event) { - if (event->orientation() == Qt::Vertical) { + QPoint p = event->angleDelta() / 120; - mapwidget_zoomfactor += event->delta() / 120; + if (!p.isNull()) { + + mapwidget_zoomfactor += p.y(); - if (mapwidget_zoomfactor < - 64) { + if (mapwidget_zoomfactor < -64) { mapwidget_zoomfactor = -64; } else if (mapwidget_zoomfactor > 64) { mapwidget_zoomfactor = 64; |