Debian Codegraph @

examples/widgets/painting/imagecomposition/imagecomposer.h

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4 #ifndef IMAGECOMPOSER_H
5 #define IMAGECOMPOSER_H
6
7 #include <QPainter>
8 #include <QWidget>
9
10 QT_BEGIN_NAMESPACE
11 class QComboBox;
12 class QLabel;
13 class QToolButton;
14 QT_END_NAMESPACE
15
16 //! [0]
17 class ImageComposer : public QWidget
18 {
19 Q_OBJECT
20
21 public:
22 ImageComposer();
23
24 private slots:
25 void chooseSource();
26 void chooseDestination();
27 void recalculateResult();
28 //! [0]
29
30 //! [1]
31 private:
32 void addOp(QPainter::CompositionMode mode, const QString &name);
33 void chooseImage(const QString &title, QImage *image, QToolButton *button);
34 void loadImage(const QString &fileName, QImage *image, QToolButton *button);
35 QPainter::CompositionMode currentMode() const;
36 QPoint imagePos(const QImage &image) const;
37
38 QToolButton *sourceButton;
39 QToolButton *destinationButton;
40 QComboBox *operatorComboBox;
41 QLabel *equalLabel;
42 QLabel *resultLabel;
43
44 QImage sourceImage;
45 QImage destinationImage;
46 QImage resultImage;
47 };
48 //! [1]
49
50 #endif // IMAGECOMPOSER_H