SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
qtColorButton.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 
11 #ifndef pq_ColorChooserButton_h
12 #define pq_ColorChooserButton_h
13 
14 #include "smtk/extension/qt/Exports.h"
15 #include "smtk/extension/qt/qtItem.h"
16 
17 #include <QColor>
18 #include <QToolButton>
19 
20 namespace smtk
21 {
22 namespace attribute
23 {
24 class SMTKQTEXT_EXPORT qtColorButton : public QToolButton
25 {
26  Q_OBJECT
27  Q_PROPERTY(QColor chosenColor READ chosenColor WRITE setChosenColor)
28 public:
30  qtColorButton(QWidget* p);
32  QColor chosenColor() const;
33 
34 Q_SIGNALS:
36  void chosenColorChanged(const QColor&);
38  void validColorChosen(const QColor&);
39 
40 public Q_SLOTS:
42  virtual void setChosenColor(const QColor&);
43 
45  virtual void chooseColor();
46 
47 protected:
49  void resizeEvent(QResizeEvent* rEvent) override;
50 
52  QIcon renderColorSwatch(const QColor&);
53 
54  QColor Color;
55 };
56 }; // namespace attribute
57 }; // namespace smtk
58 #endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::qtColorButton
Definition: qtColorButton.h:24