Qt 5.10 Book Examples
chapter21
CustomGraphicsView
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
35
void
slotRotateLeft
()
36
{
37
rotate(-5);
38
}
39
40
void
slotRotateRight
()
41
{
42
rotate(5);
43
}
44
};
MyView::slotZoomIn
void slotZoomIn()
Definition:
MyView.h:25
MyView::MyView
MyView(QGraphicsScene *pScene, QWidget *pwgt=0)
Definition:
MyView.h:19
MyView::slotRotateRight
void slotRotateRight()
Definition:
MyView.h:40
MyView
Definition:
MyView.h:16
MyView::slotRotateLeft
void slotRotateLeft()
Definition:
MyView.h:35
MyView::slotZoomOut
void slotZoomOut()
Definition:
MyView.h:30
Generated by
1.8.14