itom
Loading...
Searching...
No Matches
brushCreatorButton.h
1/* ********************************************************************
2itom measurement system
3URL: http://www.uni-stuttgart.de/ito
4Copyright (C) 2020, Institut für Technische Optik (ITO),
5Universität Stuttgart, Germany
6
7This file is part of itom.
8
9itom is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 3 of the License, or
12(at your option) any later version.
13
14itom is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23
24#ifndef BRUSHCREATORBUTTON_H
25#define BRUSHCREATORBUTTON_H
26
27#include <QPushButton>
28#include <qbrush.h>
29
30#include "commonWidgets.h"
31
33
34class ITOMWIDGETS_EXPORT BrushCreatorButton : public QPushButton
35{
36 Q_OBJECT
37
38 Q_PROPERTY(QBrush brush READ getBrush WRITE setBrush)
39 Q_PROPERTY(bool showAlphaChannel READ getShowAlphaChannel WRITE setShowAlphaChannel)
40
41public:
42 explicit BrushCreatorButton(QWidget* parent = 0);
43 explicit BrushCreatorButton(QBrush brush, QWidget* parent = 0);
45
46 QSize sizeHint() const;
47 QBrush getBrush() const;
48 bool getShowAlphaChannel() const;
49
50protected:
51 virtual void paintEvent(QPaintEvent* event);
52 void changeBrush();
53
54 QScopedPointer<BrushCreatorButtonPrivate> d_ptr;
55protected slots:
56 void onToggled(bool change = true);
57public slots:
60 void setBrush(const QBrush &brush);
61
62 void setShowAlphaChannel(bool showAlphaChannel);
63private:
64
65 Q_DECLARE_PRIVATE(BrushCreatorButton);
66 Q_DISABLE_COPY(BrushCreatorButton);
67
68};
69
70
71
72
73
74
75#endif
Definition brushCreatorButton.h:35
Definition brushCreatorButton.cpp:34