digiKam
dcolorselector.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-02-20
7  * Description : color selector widget
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DCOLOR_SELECTOR_H
25 #define DIGIKAM_DCOLOR_SELECTOR_H
26 
27 // Qt includes
28 
29 #include <QColor>
30 #include <QPushButton>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
42 class DIGIKAM_EXPORT DColorSelector : public QPushButton
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit DColorSelector(QWidget* const parent = nullptr);
49  ~DColorSelector() override;
50 
51  void setColor(const QColor& color);
52  QColor color() const;
53 
54  void setAlphaChannelEnabled(bool);
55 
56 Q_SIGNALS:
57 
58  void signalColorSelected(const QColor&);
59 
60 private Q_SLOTS:
61 
62  void slotBtnClicked();
63 
64 private:
65 
66  void paintEvent(QPaintEvent*) override;
67 
68 private:
69 
70  class Private;
71  Private* const d;
72 };
73 
74 } // namespace Digikam
75 
76 #endif // DIGIKAM_DCOLOR_SELECTOR_H
Definition: dcolorselector.h:43
void signalColorSelected(const QColor &)
Definition: datefolderview.cpp:43