aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/graphicsview.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_gui/graphicsview.h')
-rw-r--r--qtmips_gui/graphicsview.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/qtmips_gui/graphicsview.h b/qtmips_gui/graphicsview.h
index 8b47611..b970e86 100644
--- a/qtmips_gui/graphicsview.h
+++ b/qtmips_gui/graphicsview.h
@@ -38,18 +38,27 @@
#include <QGraphicsView>
#include <QGraphicsScene>
+#include <QWheelEvent>
+#include <QResizeEvent>
+#include <QKeyEvent>
class GraphicsView : public QGraphicsView {
+ Q_OBJECT
+ using Super = QGraphicsView;
+
public:
GraphicsView(QWidget *parent);
-
void setScene(QGraphicsScene *scene);
protected:
void resizeEvent(QResizeEvent *event);
+ void wheelEvent(QWheelEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
private:
void update_scale();
+ int prev_height;
+ int prev_width;
};
#endif // GRAPHICSVIEW_H