• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kcolorbutton.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 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KCOLORBUTTON_H
00021 #define KCOLORBUTTON_H
00022 
00023 #include <kdeui_export.h>
00024 
00025 #include <QtGui/QPushButton>
00026 
00027 class KColorButtonPrivate;
00037 class KDEUI_EXPORT KColorButton : public QPushButton
00038 {
00039     Q_OBJECT
00040     Q_PROPERTY( QColor color READ color WRITE setColor USER true )
00041     Q_PROPERTY( QColor defaultColor READ defaultColor WRITE setDefaultColor )
00042 
00043 public:
00047     explicit KColorButton( QWidget *parent = 0 );
00048 
00052     explicit KColorButton( const QColor &c, QWidget *parent = 0 );
00053 
00057     KColorButton( const QColor &c, const QColor &defaultColor, QWidget *parent = 0 );
00058 
00059     virtual ~KColorButton();
00060 
00064     QColor color() const;
00065 
00069      void setColor( const QColor &c );
00070 
00075     QColor defaultColor() const;
00076 
00080     void setDefaultColor( const QColor &c );
00081 
00082     QSize sizeHint() const;
00083     QSize minimumSizeHint() const;
00084 
00085 Q_SIGNALS:
00090     void changed( const QColor &newColor );
00091 
00092 protected:
00093     virtual void paintEvent( QPaintEvent *pe );
00094     virtual void dragEnterEvent( QDragEnterEvent *);
00095     virtual void dropEvent( QDropEvent *);
00096     virtual void mousePressEvent( QMouseEvent *e );
00097     virtual void mouseMoveEvent( QMouseEvent *e);
00098     virtual void keyPressEvent( QKeyEvent *e );
00099 
00100 private:
00101     class KColorButtonPrivate;
00102     KColorButtonPrivate * const d;
00103 
00104     Q_PRIVATE_SLOT( d, void _k_chooseColor() )
00105 };
00106 
00107 #endif
00108 

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal