• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Member Functions | Properties

KColorButton Class Reference

A pushbutton to display or allow user selection of a color. More...

#include <kcolorbutton.h>

Inheritance diagram for KColorButton:
Inheritance graph
[legend]

List of all members.

Signals

void changed (const QColor &newColor)

Public Member Functions

 KColorButton (QWidget *parent=0)
 KColorButton (const QColor &c, QWidget *parent=0)
 KColorButton (const QColor &c, const QColor &defaultColor, QWidget *parent=0)
virtual ~KColorButton ()
QColor color () const
QColor defaultColor () const
bool isAlphaChannelEnabled () const
QSize minimumSizeHint () const
void setAlphaChannelEnabled (bool alpha)
void setColor (const QColor &c)
void setDefaultColor (const QColor &c)
QSize sizeHint () const

Protected Member Functions

virtual void dragEnterEvent (QDragEnterEvent *)
virtual void dropEvent (QDropEvent *)
virtual void keyPressEvent (QKeyEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void paintEvent (QPaintEvent *pe)

Properties

bool alphaChannelEnabled
QColor color
QColor defaultColor

Detailed Description

A pushbutton to display or allow user selection of a color.

This widget can be used to display or allow user selection of a color.

See also:
KColorDialog
kcolorbutton.png

KDE Color Button

Definition at line 37 of file kcolorbutton.h.


Constructor & Destructor Documentation

KColorButton::KColorButton ( QWidget *  parent = 0) [explicit]

Creates a color button.

Definition at line 70 of file kcolorbutton.cpp.

KColorButton::KColorButton ( const QColor &  c,
QWidget *  parent = 0 
) [explicit]

Creates a color button with an initial color c.

Definition at line 76 of file kcolorbutton.cpp.

KColorButton::KColorButton ( const QColor &  c,
const QColor &  defaultColor,
QWidget *  parent = 0 
)

Creates a color button with an initial color c and default color defaultColor.

Definition at line 83 of file kcolorbutton.cpp.

KColorButton::~KColorButton ( ) [virtual]

Definition at line 91 of file kcolorbutton.cpp.


Member Function Documentation

void KColorButton::changed ( const QColor &  newColor) [signal]

Emitted when the color of the widget is changed, either with setColor() or via user selection.

QColor KColorButton::color ( ) const

Returns the currently chosen color.

QColor KColorButton::defaultColor ( ) const

Returns the default color or an invalid color if no default color is set.

void KColorButton::dragEnterEvent ( QDragEnterEvent *  event) [protected, virtual]

Definition at line 198 of file kcolorbutton.cpp.

void KColorButton::dropEvent ( QDropEvent *  event) [protected, virtual]

Definition at line 203 of file kcolorbutton.cpp.

bool KColorButton::isAlphaChannelEnabled ( ) const

Returns true if the user is allowed to change the alpha component.

Since:
4.5

Definition at line 115 of file kcolorbutton.cpp.

void KColorButton::keyPressEvent ( QKeyEvent *  e) [protected, virtual]

Definition at line 211 of file kcolorbutton.cpp.

QSize KColorButton::minimumSizeHint ( ) const

Definition at line 190 of file kcolorbutton.cpp.

void KColorButton::mouseMoveEvent ( QMouseEvent *  e) [protected, virtual]

Definition at line 234 of file kcolorbutton.cpp.

void KColorButton::mousePressEvent ( QMouseEvent *  e) [protected, virtual]

Definition at line 228 of file kcolorbutton.cpp.

void KColorButton::paintEvent ( QPaintEvent *  pe) [protected, virtual]

Definition at line 142 of file kcolorbutton.cpp.

void KColorButton::setAlphaChannelEnabled ( bool  alpha)

When set to true, allow the user to change the alpha component of the color.

The default value is false.

Since:
4.5

Definition at line 110 of file kcolorbutton.cpp.

void KColorButton::setColor ( const QColor &  c)

Sets the current color to c.

Definition at line 101 of file kcolorbutton.cpp.

void KColorButton::setDefaultColor ( const QColor &  c)

Sets the default color to c.

Definition at line 125 of file kcolorbutton.cpp.

QSize KColorButton::sizeHint ( ) const

Definition at line 182 of file kcolorbutton.cpp.


Property Documentation

bool KColorButton::alphaChannelEnabled [read, write]

Definition at line 42 of file kcolorbutton.h.

QColor KColorButton::color [read, write]

Definition at line 40 of file kcolorbutton.h.

QColor KColorButton::defaultColor [read, write]

Definition at line 41 of file kcolorbutton.h.


The documentation for this class was generated from the following files:
  • kcolorbutton.h
  • kcolorbutton.cpp

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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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