00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VRN_COLORPROPERTYWIDGET_H
00029 #define VRN_COLORPROPERTYWIDGET_H
00030
00031 #include "voreen/qt/widgets/property/qpropertywidget.h"
00032
00033 #include "tgt/vector.h"
00034
00035 #include <QLabel>
00036
00037 namespace voreen {
00038
00039 class ColorProperty;
00040
00041 class ClickableColorLabel : public QLabel {
00042 Q_OBJECT
00043 public:
00044 ClickableColorLabel(const QString& text, QWidget* parent=0, Qt::WindowFlags f=0);
00045 void setColor(const QColor& color);
00046
00047 signals:
00048 void clicked();
00049
00050 protected:
00051 void mousePressEvent(QMouseEvent* e);
00052 void paintEvent(QPaintEvent* event);
00053
00054 QColor color_;
00055 };
00056
00057 class ColorPropertyWidget : public QPropertyWidget {
00058 Q_OBJECT
00059 public:
00060 ColorPropertyWidget(ColorProperty* prop, QWidget* parent = 0);
00061
00062 void updateFromProperty();
00063
00064 public slots:
00065 void setProperty();
00066
00067 protected:
00068 void colorDialog();
00069 void updateColorLabel();
00070 tgt::Color toTgtColor(QColor color);
00071 QColor toQColor(tgt::Color color);
00072
00073 private:
00074 ColorProperty* property_;
00075 ClickableColorLabel* colorLbl_;
00076 QColor currentColor_;
00077 };
00078
00079 }
00080
00081 #endif // VRN_COLORPROPERTYWIDGET_H