itom
Loading...
Searching...
No Matches
penCreatorButton.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 PENCREATORBUTTON_H
25#define PENCREATORBUTTON_H
26
27#include <QPushButton>
28#include <qpen.h>
29
30#include "commonWidgets.h"
31
33
34class ITOMWIDGETS_EXPORT PenCreatorButton : public QPushButton
35{
36 Q_OBJECT
37
38 Q_PROPERTY(QPen pen READ getPen WRITE setPen)
39 Q_PROPERTY(bool editableColor READ getColorState WRITE setColorState DESIGNABLE true)
40
41public:
42 explicit PenCreatorButton(QWidget* parent = 0);
43 explicit PenCreatorButton(QPen pen, QWidget* parent = 0 );
45
46 QSize sizeHint() const;
47 QPen getPen() const;
48 bool getColorState() const;
49
50protected:
51 virtual void paintEvent(QPaintEvent* event);
52 void changePen();
53
54 QScopedPointer<PenCreatorButtonPrivate> d_ptr;
55protected slots:
56 void onToggled(bool change = true);
57public slots:
60 void setPen(const QPen &pen);
61 void setColorState(const bool &val);
62private:
63
64 Q_DECLARE_PRIVATE(PenCreatorButton);
65 Q_DISABLE_COPY(PenCreatorButton);
66 signals:
67 void colorStateChanged(bool state);
68
69};
70
71
72
73
74
75
76#endif
Definition penCreatorButton.h:35
Definition penCreatorButton.cpp:34