kalzium
colorbutton.h
Go to the documentation of this file.00001 /********************************************************************** 00002 ColorButton - Button widget to display the current selected color 00003 and bring up the color picker when clicked 00004 00005 Copyright (C) 2008 Geoffrey Hutchison 00006 00007 This file is part of the Avogadro molecular editor project. 00008 For more information, see <http://avogadro.sourceforge.net/> 00009 00010 Avogadro is free software; you can redistribute it and/or modify 00011 it under the terms of the GNU General Public License as published by 00012 the Free Software Foundation; either version 2 of the License, or 00013 (at your option) any later version. 00014 00015 Avogadro is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00023 02110-1301, USA. 00024 **********************************************************************/ 00025 00026 #ifndef COLORBUTTON_H 00027 #define COLORBUTTON_H 00028 00029 #include <avogadro/global.h> 00030 00031 #include <QAbstractButton> 00032 #include <QColor> 00033 00046 class A_EXPORT ColorButton : public QAbstractButton 00047 { 00048 Q_OBJECT 00049 00050 public: 00051 ColorButton(QWidget *parent = 0); 00052 explicit ColorButton(const QColor& initial, QWidget *parent = 0); 00053 00057 void paintEvent(QPaintEvent *); 00058 00062 void setColor(const QColor& color); 00063 00067 QColor color() const; 00068 00069 signals: 00073 void colorChanged(QColor); 00074 00075 public slots: 00079 void changeColor(); 00080 00081 protected: 00082 QColor m_color; 00083 }; 00084 00085 #endif
KDE 4.2 API Reference