Qt 5.10 Book Examples
MyView.h
Go to the documentation of this file.
1 // ======================================================================
2 // MyView.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QGraphicsView>
14 
15 // ======================================================================
16 class MyView: public QGraphicsView {
17 Q_OBJECT
18 public:
19  MyView(QGraphicsScene* pScene, QWidget* pwgt = 0)
20  : QGraphicsView(pScene, pwgt)
21  {
22  }
23 
24 public slots:
25  void slotZoomIn()
26  {
27  scale(1.1, 1.1);
28  }
29 
30  void slotZoomOut()
31  {
32  scale(1 / 1.1, 1 / 1.1);
33  }
34 
36  {
37  rotate(-5);
38  }
39 
41  {
42  rotate(5);
43  }
44 };
void slotZoomIn()
Definition: MyView.h:25
MyView(QGraphicsScene *pScene, QWidget *pwgt=0)
Definition: MyView.h:19
void slotRotateRight()
Definition: MyView.h:40
Definition: MyView.h:16
void slotRotateLeft()
Definition: MyView.h:35
void slotZoomOut()
Definition: MyView.h:30