.TH "KColorDialog" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KColorDialog \- A color selection dialog.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kcolordialog.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetColor\fP (const \fBQColor\fP &col)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBcolorSelected\fP (const \fBQColor\fP &col)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKColorDialog\fP (\fBQWidget\fP *parent=0L, const char *name=0L, bool modal=false)"
.br
.ti -1c
.RI "\fB~KColorDialog\fP ()"
.br
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP () const "
.br
.ti -1c
.RI "void \fBsetDefaultColor\fP (const \fBQColor\fP &defaultCol)"
.br
.ti -1c
.RI "\fBQColor\fP \fBdefaultColor\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static int \fBgetColor\fP (\fBQColor\fP &theColor, \fBQWidget\fP *parent=0L)"
.br
.ti -1c
.RI "static int \fBgetColor\fP (\fBQColor\fP &theColor, const \fBQColor\fP &defaultColor, \fBQWidget\fP *parent=0L)"
.br
.ti -1c
.RI "static \fBQColor\fP \fBgrabColor\fP (const \fBQPoint\fP &p)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBkeyPressEvent\fP (\fBQKeyEvent\fP *)"
.br
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *obj, \fBQEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A color selection dialog. 

\fBFeatures:\fP
.br
.PP
.PD 0
.IP "\(bu" 2
Color selection from a wide range of palettes. 
.IP "\(bu" 2
Color selection from a palette of H vs S and V selectors (similar to windoze). 
.IP "\(bu" 2
Direct input of HSV or RGB values. 
.IP "\(bu" 2
Saving of custom colors
.PP
In most cases, you will want to use the static method \fBKColorDialog::getColor()\fP. This pops up the dialog (with an initial selection provided by you), lets the user choose a color, and returns.
.PP
Example:
.PP
.PP
.nf
    QColor myColor;
    int result = KColorDialog::getColor( myColor );
         if ( result == KColorDialog::Accepted )
            ...
.fi
.PP
.PP
KDE Color Dialog The color dialog is really a collection of several widgets which can you can also use separately: the quadratic plane in the top left of the dialog is a \fBKXYSelector\fP. Right next to it is a \fBKHSSelector\fP for choosing hue/saturation.
.PP
On the right side of the dialog you see a \fBKPaletteTable\fP showing up to 40 colors with a combo box which offers several predefined palettes or a palette configured by the user. The small field showing the currently selected color is a \fBKColorPatch\fP. 
.PP
Definition at line 375 of file kcolordialog.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KColorDialog::KColorDialog (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP, bool modal = \fCfalse\fP)"
.PP
Constructs a color selection dialog. 
.PP
Definition at line 915 of file kcolordialog.cpp.
.PP
References QGridLayout::addLayout(), QGridLayout::addMultiCellWidget(), QGridLayout::addWidget(), KDialogBase::closeClicked(), colorSelected(), KDialogBase::disableResize(), KDialogBase::okClicked(), setColor(), QGridLayout::setColStretch(), KDialogBase::setHelp(), KColor::setHsv(), KDialogBase::setMainWidget(), QWidget::setMinimumSize(), QPushButton::setPixmap(), QPushButton::setText(), QWidget::sizeHint(), and KDialog::spacingHint().
.SS "KColorDialog::~\fBKColorDialog\fP ()"
.PP
Destroys the color selection dialog. 
.PP
Definition at line 1155 of file kcolordialog.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQColor\fP KColorDialog::color () const"
.PP
Returns the currently selected color. 
.PP
Definition at line 1262 of file kcolordialog.cpp.
.PP
Referenced by getColor().
.SS "int KColorDialog::getColor (\fBQColor\fP & theColor, \fBQWidget\fP * parent = \fC0L\fP)\fC [static]\fP"
.PP
Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed. 
.PP
The selected color is returned in the argument \fCtheColor\fP.
.PP
\fBReturns:\fP
.RS 4
\fBQDialog::result()\fP. 
.RE
.PP

.PP
Definition at line 1279 of file kcolordialog.cpp.
.PP
References color(), QDialog::exec(), and setColor().
.SS "int KColorDialog::getColor (\fBQColor\fP & theColor, const \fBQColor\fP & defaultColor, \fBQWidget\fP * parent = \fC0L\fP)\fC [static]\fP"
.PP
Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed. 
.PP
The selected color is returned in the argument \fCtheColor\fP.
.PP
This version takes a \fCdefaultColor\fP argument, which sets the color selected by the 'default color' checkbox. When this checkbox is checked, the invalid color (QColor()) is returned into \fCtheColor\fP.
.PP
\fBReturns:\fP
.RS 4
\fBQDialog::result()\fP. 
.RE
.PP

.PP
Definition at line 1297 of file kcolordialog.cpp.
.PP
References color(), QDialog::exec(), setColor(), and setDefaultColor().
.SS "\fBQColor\fP KColorDialog::grabColor (const \fBQPoint\fP & p)\fC [static]\fP"
.PP
Gets the color from the pixel at point p on the screen. 
.PP
Definition at line 1514 of file kcolordialog.cpp.
.PP
References QPixmap::convertToImage(), QApplication::desktop(), QPixmap::grabWindow(), QImage::pixel(), QWidget::winId(), QWidget::x(), and QWidget::y().
.SS "void KColorDialog::setDefaultColor (const \fBQColor\fP & defaultCol)"
.PP
Call this to make the dialog show a 'Default Color' checkbox. 
.PP
If this checkbox is selected, the dialog will return an 'invalid' color (QColor()). This can be used to mean 'the default text color', for instance, the one with the \fBKDE\fP text color on screen, but black when printing. 
.PP
Definition at line 1184 of file kcolordialog.cpp.
.PP
References KDialogBase::disableResize(), KDialogBase::mainWidget(), QWidget::setMaximumSize(), and QWidget::setMinimumSize().
.PP
Referenced by getColor().
.SS "\fBQColor\fP KColorDialog::defaultColor () const"
.PP
\fBReturns:\fP
.RS 4
the value passed to setDefaultColor 
.RE
.PP

.PP
Definition at line 1214 of file kcolordialog.cpp.
.SS "void KColorDialog::setColor (const \fBQColor\fP & col)\fC [slot]\fP"
.PP
Preselects a color. 
.PP
Definition at line 1271 of file kcolordialog.cpp.
.PP
Referenced by getColor(), and KColorDialog().
.SS "void KColorDialog::colorSelected (const \fBQColor\fP & col)\fC [signal]\fP"
.PP
Emitted when a color is selected. 
.PP
Connect to this to monitor the color as it as selected if you are not running modal. 
.PP
Referenced by KColorDialog().
.SS "void KColorDialog::keyPressEvent (\fBQKeyEvent\fP *)\fC [protected, virtual]\fP"
.PP
Maps some keys to the actions buttons. 
.PP
F1 is mapped to the Help button if present and Escape to the Cancel or Close if present. The button action event is animated. 
.PP
Reimplemented from \fBKDialogBase\fP.
.PP
Definition at line 1523 of file kcolordialog.cpp.
.PP
References KDialogBase::keyPressEvent().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
