.TH "KColorDialog" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KColorDialog \- The KColorDialog provides a dialog for color selection. 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
.RI "\fIPreselects a color. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBcolorSelected\fP (const  \fBQColor\fP &col)"
.br
.RI "\fIEmitted when a color is selected. \fP"
.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
.RI "\fIConstructs a color selection dialog. \fP"
.ti -1c
.RI "\fB~KColorDialog\fP ()"
.br
.RI "\fIDestroys the color selection dialog. \fP"
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP () const "
.br
.RI "\fIReturns the currently selected color. \fP"
.ti -1c
.RI "void \fBsetDefaultColor\fP (const  \fBQColor\fP &defaultCol)"
.br
.RI "\fICall this to make the dialog show a 'Default Color' checkbox. \fP"
.ti -1c
.RI "\fBQColor\fP \fBdefaultColor\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "int \fBgetColor\fP (\fBQColor\fP &theColor, \fBQWidget\fP *parent=0L)"
.br
.RI "\fICreates a modal color dialog, let the user choose a color, and returns when the dialog is closed. \fP"
.ti -1c
.RI "int \fBgetColor\fP (\fBQColor\fP &theColor, const  \fBQColor\fP &defaultColor, \fBQWidget\fP *parent=0L)"
.br
.RI "\fICreates a modal color dialog, lets the user choose a color, and returns when the dialog is closed. \fP"
.ti -1c
.RI "\fBQColor\fP \fBgrabColor\fP (const  \fBQPoint\fP &p)"
.br
.RI "\fIGets the color from the pixel at point p on the screen. \fP"
.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
.RI "\fIMaps some keys to the actions buttons. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
The KColorDialog provides a dialog for color selection. A color selection dialog. 

\fB Features:\fP
.PP
\fB 
.IP "\(bu" 2
Colour selection from a wide range of palettes. 
.IP "\(bu" 2
Colour 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.\fP
.PP
\fB Example:\fP
.PP
\fB 
.PP
.nf

 	\fBQColor\fP myColor;
 	int result = KColorDialog::getColor( myColor );
         if ( result == KColorDialog::Accepted )
            ...
 
.PP
\fP
.PP
\fB 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 chosing hue/saturation.\fP
.PP
\fB 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.\fP
.PP
\fB\fP
.PP
\fB \fP
.PP
Definition at line 405 of file kcolordialog.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KColorDialog::KColorDialog (\fBQWidget\fP * parent = 0L, const char * name = 0L, bool modal = FALSE)"
.PP
Constructs a color selection dialog. 
.SS "KColorDialog::~\fBKColorDialog\fP ()"
.PP
Destroys the color selection dialog. 
.SH "Member Function Documentation"
.PP 
.SS "\fBQColor\fP KColorDialog::color () const"
.PP
Returns the currently selected color. 
.SS "int KColorDialog::getColor (\fBQColor\fP & theColor, \fBQWidget\fP * parent = 0L)\fC [static]\fP"
.PP
Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed. The selected color is returned in the argument \fCtheColor\fP.
.PP
\fBReturns:\fP
.RS 4
\fBQDialog::result\fP(). 
.RE
.PP

.SS "int KColorDialog::getColor (\fBQColor\fP & theColor, const \fBQColor\fP & defaultColor, \fBQWidget\fP * parent = 0L)\fC [static]\fP"
.PP
Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed. 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

.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. 
.SS "void KColorDialog::setDefaultColor (const \fBQColor\fP & defaultCol)"
.PP
Call this to make the dialog show a 'Default Color' checkbox. 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. 
.SS "\fBQColor\fP KColorDialog::defaultColor () const"
.PP
\fBReturns:\fP
.RS 4
the value passed to setDefaultColor 
.RE
.PP

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

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