KDEUI
kcolorcombo.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1997 Martin Jones (mjones@kde.org) 00003 Copyright (c) 2007 David Jarvie (software@astrojar.org.uk) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 //----------------------------------------------------------------------------- 00021 // KDE color selection combo box 00022 00023 // layout management added Oct 1997 by Mario Weilguni 00024 // <mweilguni@sime.com> 00025 00026 00027 #ifndef KCOLORCOMBO_H 00028 #define KCOLORCOMBO_H 00029 00030 #include <QtGui/QComboBox> 00031 #include <QtCore/QList> 00032 00033 #include <kdeui_export.h> 00034 00035 class KColorComboPrivate; 00036 00045 class KDEUI_EXPORT KColorCombo : public QComboBox 00046 { 00047 Q_OBJECT 00048 Q_PROPERTY( QColor color READ color WRITE setColor NOTIFY activated USER true ) 00049 Q_PROPERTY( QList<QColor> colors READ colors WRITE setColors ) 00050 00051 public: 00055 explicit KColorCombo(QWidget *parent = 0); 00056 ~KColorCombo(); 00057 00061 void setColor( const QColor &col ); 00065 QColor color() const; 00066 00071 bool isCustomColor() const; 00072 00079 void setColors(const QList<QColor> &colors ); 00080 00085 QList<QColor> colors() const; 00086 00090 void showEmptyList(); 00091 00092 Q_SIGNALS: 00096 void activated( const QColor &col ); 00100 void highlighted( const QColor &col ); 00101 00102 protected: 00103 virtual void paintEvent(QPaintEvent *event); 00104 00105 private: 00106 friend class KColorComboPrivate; 00107 KColorComboPrivate *const d; 00108 00109 Q_DISABLE_COPY(KColorCombo) 00110 00111 Q_PRIVATE_SLOT(d, void _k_slotActivated(int)) 00112 Q_PRIVATE_SLOT(d, void _k_slotHighlighted(int)) 00113 }; 00114 00115 #endif // KCOLORCOMBO_H
KDE 4.6 API Reference