KProperty

KColorCombo.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 Martin Jones ([email protected])
3  Copyright (c) 2007 David Jarvie ([email protected])
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 //-----------------------------------------------------------------------------
21 // KDE color selection combo box
22 
23 // layout management added Oct 1997 by Mario Weilguni
24 // <[email protected]>
25 
26 #ifndef KCOLORCOMBO_H
27 #define KCOLORCOMBO_H
28 
29 #include <QComboBox>
30 #include <QList>
31 
32 class KColorComboPrivate;
33 
42 class KColorCombo : public QComboBox
43 {
44  Q_OBJECT
45  Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY activated USER true)
47 
48 public:
52  explicit KColorCombo(QWidget *parent = 0);
53  ~KColorCombo();
54 
58  void setColor(const QColor &col);
59 
63  QColor color() const;
64 
69  bool isCustomColor() const;
70 
77  void setColors(const QList<QColor> &colors);
78 
83  QList<QColor> colors() const;
84 
88  void showEmptyList();
89 
90 Q_SIGNALS:
94  void activated(const QColor &col);
98  void highlighted(const QColor &col);
99 
100 protected:
101  void paintEvent(QPaintEvent *event) override;
102 
103 private:
104  friend class KColorComboPrivate;
105  KColorComboPrivate *const d;
106 
108 
109  Q_PRIVATE_SLOT(d, void _k_slotActivated(int))
110  Q_PRIVATE_SLOT(d, void _k_slotHighlighted(int))
111 };
112 
113 #endif // KCOLORCOMBO_H
QColor color() const
void highlighted(const QColor &col)
KColorCombo(QWidget *parent=nullptr)
Q_SIGNALSQ_SIGNALS
void setColors(const QList< QColor > &colors)
virtual bool event(QEvent *event) override
Combobox for colors.
Definition: KColorCombo.h:42
Q_OBJECTQ_OBJECT
void setColor(const QColor &col)
Q_PROPERTY(...)
void activated(const QColor &col)
bool isCustomColor() const
QList< QColor > colors() const
Q_DISABLE_COPY(Class)
void showEmptyList()
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 7 2020 23:01:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.