ctkColorPickerButton.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   CTK
00004  
00005   Copyright (c) 2010  Kitware Inc.
00006 
00007   Licensed under the Apache License, Version 2.0 (the "License");
00008   you may not use this file except in compliance with the License.
00009   You may obtain a copy of the License at
00010 
00011       http://www.commontk.org/LICENSE
00012 
00013   Unless required by applicable law or agreed to in writing, software
00014   distributed under the License is distributed on an "AS IS" BASIS,
00015   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016   See the License for the specific language governing permissions and
00017   limitations under the License.
00018  
00019 =========================================================================*/
00020 
00021 #ifndef __ctkColorPickerButton_h
00022 #define __ctkColorPickerButton_h
00023 
00024 // Qt includes
00025 #include <QPushButton>
00026 #include <QColor>
00027 
00028 // CTK includes
00029 #include "CTKWidgetsExport.h"
00030 
00036 class CTK_WIDGETS_EXPORT ctkColorPickerButton : public QPushButton
00037 {
00038   Q_OBJECT
00039   Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged USER true)
00040 public:
00041   explicit ctkColorPickerButton(QWidget* parent = 0);
00042   explicit ctkColorPickerButton(const QString& text, QWidget* parent = 0 );
00043   explicit ctkColorPickerButton(const QColor& color, const QString & text, QWidget* parent = 0 );
00044   virtual ~ctkColorPickerButton(){}
00045   
00048   QColor color()const;
00049 
00050 public slots:
00053   void setColor(const QColor& color);
00054 
00057   void changeColor(bool change = true);
00058 
00059 signals:
00060   void colorChanged(QColor);
00061 
00062 protected:
00063   QColor Color;
00064 };
00065 
00066 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1