diff options
Diffstat (limited to 'demos/chip/view.h')
-rw-r--r-- | demos/chip/view.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/demos/chip/view.h b/demos/chip/view.h index 8047b8b..67c7675 100644 --- a/demos/chip/view.h +++ b/demos/chip/view.h @@ -43,12 +43,27 @@ #define VIEW_H #include <QFrame> +#include <QGraphicsView> -QT_FORWARD_DECLARE_CLASS(QGraphicsView) QT_FORWARD_DECLARE_CLASS(QLabel) QT_FORWARD_DECLARE_CLASS(QSlider) QT_FORWARD_DECLARE_CLASS(QToolButton) +class View; + +class GraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + GraphicsView(View *v) : QGraphicsView(), view(v) { } + +protected: + void wheelEvent(QWheelEvent *); + +private: + View *view; +}; + class View : public QFrame { Q_OBJECT @@ -57,22 +72,27 @@ public: QGraphicsView *view() const; +public slots: + void zoomIn(int level = 1); + void zoomOut(int level = 1); + private slots: void resetView(); void setResetButtonEnabled(); void setupMatrix(); + void togglePointerMode(); void toggleOpenGL(); void toggleAntialiasing(); void print(); - - void zoomIn(); - void zoomOut(); void rotateLeft(); void rotateRight(); - + private: - QGraphicsView *graphicsView; + GraphicsView *graphicsView; QLabel *label; + QLabel *label2; + QToolButton *selectModeButton; + QToolButton *dragModeButton; QToolButton *openGlButton; QToolButton *antialiasButton; QToolButton *printButton; |