qt5base-lts/examples/widgets/graphicsview/chip/view.h
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

71 lines
1.3 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef VIEW_H
#define VIEW_H
#include <QFrame>
#include <QGraphicsView>
QT_BEGIN_NAMESPACE
class QLabel;
class QSlider;
class QToolButton;
QT_END_NAMESPACE
class View;
class GraphicsView : public QGraphicsView
{
Q_OBJECT
public:
GraphicsView(View *v) : QGraphicsView(), view(v) { }
protected:
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) override;
#endif
private:
View *view;
};
class View : public QFrame
{
Q_OBJECT
public:
explicit View(const QString &name, QWidget *parent = nullptr);
QGraphicsView *view() const;
public slots:
void zoomIn();
void zoomOut();
void zoomInBy(int level);
void zoomOutBy(int level);
private slots:
void resetView();
void setResetButtonEnabled();
void setupMatrix();
void togglePointerMode();
void toggleAntialiasing();
void print();
void rotateLeft();
void rotateRight();
private:
GraphicsView *graphicsView;
QLabel *label;
QLabel *label2;
QToolButton *selectModeButton;
QToolButton *dragModeButton;
QToolButton *antialiasButton;
QToolButton *printButton;
QToolButton *resetButton;
QSlider *zoomSlider;
QSlider *rotateSlider;
};
#endif // VIEW_H