digiKam
colorgradientwidget.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 : 2004-07-28
7  * Description : a color gradient widget
8  *
9  * Copyright (C) 2004-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_COLOR_GRADIENT_WIDGET_H
25 #define DIGIKAM_COLOR_GRADIENT_WIDGET_H
26 
27 // KDE includes
28 
29 #include <QWidget>
30 #include <QColor>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_EXPORT ColorGradientWidget : public QWidget
40 {
41  Q_OBJECT
42 
43 public:
44 
45  explicit ColorGradientWidget(Qt::Orientation orientation, int size, QWidget* const parent = nullptr);
46  ~ColorGradientWidget() override;
47 
48  void setColors(const QColor& col1, const QColor& col2);
49 
50 protected:
51 
52  void paintEvent(QPaintEvent*) override;
53 
54 private:
55 
56  class Private;
57  Private* const d;
58 };
59 
60 } // namespace Digikam
61 
62 #endif // DIGIKAM_COLOR_GRADIENT_WIDGET_H
Definition: colorgradientwidget.h:40
@ Orientation
Definition: coredbfields.h:86
Definition: datefolderview.cpp:43