VisLU Flow 0.1
|
00001 /* 00002 00003 Copyright (C) 2009, Etienne Moutot <e.moutot@gmail.com> 00004 00005 This file is part of colorPickerWidget. 00006 00007 colorPickerWidget is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 colorPickerWidget is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Foobar. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef COLORVIEWER_H 00022 #define COLORVIEWER_H 00023 00024 #include <QtGui/QWidget> 00025 #include <QtGui/QPainter> 00026 #include <QPaintEvent> 00027 00028 class ColorViewer : public QWidget 00029 { 00030 Q_OBJECT 00031 00032 public: 00033 ColorViewer(QWidget *parent = 0); 00034 ~ColorViewer(); 00035 00036 void setPen(const QPen &pen); 00037 QPen pen() const; 00038 00039 void setColor(const QColor &color); 00040 QColor color() const; 00041 00042 public slots: 00043 void changeColor(const QColor &color); 00044 00045 protected: 00046 void paintEvent(QPaintEvent *event); 00047 00048 private: 00049 QPen actualPen; 00050 QBrush actualBrush; 00051 QColor actualColor; 00052 }; 00053 00054 #endif // COLORVIEWER_H