\section{KColor\-Dialog Class Reference}
\label{classKColorDialog}\index{KColorDialog@{KColorDialog}}
The KColor\-Dialog provides a dialog for color selection. A color selection dialog.  


{\tt \#include $<$kcolordialog.h$>$}

Inheritance diagram for KColor\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=57pt]{classKColorDialog__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KColor\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=57pt]{classKColorDialog__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf set\-Color} (const  {\bf QColor} \&col)
\begin{CompactList}\small\item\em Preselects a color. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf color\-Selected} (const  {\bf QColor} \&col)
\begin{CompactList}\small\item\em Emitted when a color is selected. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KColor\-Dialog} ({\bf QWidget} $\ast$parent=0L, const  char $\ast$name=0L, bool modal=FALSE)
\begin{CompactList}\small\item\em Constructs a color selection dialog. \item\end{CompactList}\item 
{\bf $\sim$KColor\-Dialog} ()
\begin{CompactList}\small\item\em Destroys the color selection dialog. \item\end{CompactList}\item 
{\bf QColor} {\bf color} () const 
\begin{CompactList}\small\item\em Returns the currently selected color. \item\end{CompactList}\item 
void {\bf set\-Default\-Color} (const  {\bf QColor} \&default\-Col)
\begin{CompactList}\small\item\em Call this to make the dialog show a \char`\"{}Default Color\char`\"{} checkbox. \item\end{CompactList}\item 
{\bf QColor} {\bf default\-Color} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf get\-Color} ({\bf QColor} \&the\-Color, {\bf QWidget} $\ast$parent=0L)
\begin{CompactList}\small\item\em Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed. \item\end{CompactList}\item 
int {\bf get\-Color} ({\bf QColor} \&the\-Color, const  {\bf QColor} \&default\-Color, {\bf QWidget} $\ast$parent=0L)
\begin{CompactList}\small\item\em Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed. \item\end{CompactList}\item 
{\bf QColor} {\bf grab\-Color} (const  {\bf QPoint} \&p)
\begin{CompactList}\small\item\em Gets the color from the pixel at point p on the screen. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf mouse\-Release\-Event} ({\bf QMouse\-Event} $\ast$)\label{classKColorDialog_b0}

\item 
virtual void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$)
\begin{CompactList}\small\item\em Maps some keys to the actions buttons. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKColorDialog_b2}

\end{CompactItemize}


\subsection{Detailed Description}
The KColor\-Dialog provides a dialog for color selection. A color selection dialog. 

{\bf  Features:}

{\bf  \begin{itemize}
\item Colour selection from a wide range of palettes. \item Colour selection from a palette of H vs S and V selectors (similar to windoze). \item Direct input of HSV or RGB values. \item Saving of custom colors\end{itemize}
In most cases, you will want to use the static method {\bf KColor\-Dialog::get\-Color}{\rm (p.\,\pageref{classKColorDialog_e0})}(). This pops up the dialog (with an initial selection provided by you), lets the user choose a color, and returns.}

{\bf  Example:}

{\bf  \small\begin{alltt}
 	{\bf QColor} myColor;
 	int result = KColorDialog::getColor( myColor );
         if ( result == KColorDialog::Accepted )
            ...
 \end{alltt}\normalsize 
}

{\bf   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 {\bf KXYSelector}{\rm (p.\,\pageref{classKXYSelector})}. Right next to it is a {\bf KHSSelector}{\rm (p.\,\pageref{classKHSSelector})} for chosing hue/saturation.}

{\bf  On the right side of the dialog you see a {\bf KPalette\-Table}{\rm (p.\,\pageref{classKPaletteTable})} 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 {\bf KColor\-Patch}{\rm (p.\,\pageref{classKColorPatch})}.}

{\bf }

{\bf  }



Definition at line 405 of file kcolordialog.h.

\subsection{Constructor \& Destructor Documentation}
\index{KColorDialog@{KColor\-Dialog}!KColorDialog@{KColorDialog}}
\index{KColorDialog@{KColorDialog}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KColor\-Dialog::KColor\-Dialog ({\bf QWidget} $\ast$ {\em parent} = 0L, const char $\ast$ {\em name} = 0L, bool {\em modal} = FALSE)}\label{classKColorDialog_a0}


Constructs a color selection dialog. 

\index{KColorDialog@{KColor\-Dialog}!~KColorDialog@{$\sim$KColorDialog}}
\index{~KColorDialog@{$\sim$KColorDialog}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KColor\-Dialog::$\sim${\bf KColor\-Dialog} ()}\label{classKColorDialog_a1}


Destroys the color selection dialog. 



\subsection{Member Function Documentation}
\index{KColorDialog@{KColor\-Dialog}!color@{color}}
\index{color@{color}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QColor} KColor\-Dialog::color () const}\label{classKColorDialog_a2}


Returns the currently selected color. 

\index{KColorDialog@{KColor\-Dialog}!getColor@{getColor}}
\index{getColor@{getColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KColor\-Dialog::get\-Color ({\bf QColor} \& {\em the\-Color}, {\bf QWidget} $\ast$ {\em parent} = 0L)\hspace{0.3cm}{\tt  [static]}}\label{classKColorDialog_e0}


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 {\tt the\-Color}.

\begin{Desc}
\item[Returns:]{\bf QDialog::result}(). \end{Desc}
\index{KColorDialog@{KColor\-Dialog}!getColor@{getColor}}
\index{getColor@{getColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KColor\-Dialog::get\-Color ({\bf QColor} \& {\em the\-Color}, const {\bf QColor} \& {\em default\-Color}, {\bf QWidget} $\ast$ {\em parent} = 0L)\hspace{0.3cm}{\tt  [static]}}\label{classKColorDialog_e1}


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 {\tt the\-Color}.

This version takes a {\tt default\-Color} argument, which sets the color selected by the \char`\"{}default color\char`\"{} checkbox. When this checkbox is checked, the invalid color (QColor()) is returned into {\tt the\-Color}.

\begin{Desc}
\item[Returns:]{\bf QDialog::result}(). \end{Desc}
\index{KColorDialog@{KColor\-Dialog}!grabColor@{grabColor}}
\index{grabColor@{grabColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QColor} KColor\-Dialog::grab\-Color (const {\bf QPoint} \& {\em p})\hspace{0.3cm}{\tt  [static]}}\label{classKColorDialog_e2}


Gets the color from the pixel at point p on the screen. 

\index{KColorDialog@{KColor\-Dialog}!setDefaultColor@{setDefaultColor}}
\index{setDefaultColor@{setDefaultColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KColor\-Dialog::set\-Default\-Color (const {\bf QColor} \& {\em default\-Col})}\label{classKColorDialog_a3}


Call this to make the dialog show a \char`\"{}Default Color\char`\"{} checkbox. 

If this checkbox is selected, the dialog will return an \char`\"{}invalid\char`\"{} color (QColor()). This can be used to mean \char`\"{}the default text color\char`\"{}, for instance, the one with the {\bf KDE} text color on screen, but black when printing. \index{KColorDialog@{KColor\-Dialog}!defaultColor@{defaultColor}}
\index{defaultColor@{defaultColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QColor} KColor\-Dialog::default\-Color () const}\label{classKColorDialog_a4}


\begin{Desc}
\item[Returns:]the value passed to set\-Default\-Color \end{Desc}
\index{KColorDialog@{KColor\-Dialog}!setColor@{setColor}}
\index{setColor@{setColor}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KColor\-Dialog::set\-Color (const {\bf QColor} \& {\em col})\hspace{0.3cm}{\tt  [slot]}}\label{classKColorDialog_i0}


Preselects a color. 

\index{KColorDialog@{KColor\-Dialog}!colorSelected@{colorSelected}}
\index{colorSelected@{colorSelected}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KColor\-Dialog::color\-Selected (const {\bf QColor} \& {\em col})\hspace{0.3cm}{\tt  [signal]}}\label{classKColorDialog_l0}


Emitted when a color is selected. 

Connect to this to monitor the color as it as selected if you are not running modal. \index{KColorDialog@{KColor\-Dialog}!keyPressEvent@{keyPressEvent}}
\index{keyPressEvent@{keyPressEvent}!KColorDialog@{KColor\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KColor\-Dialog::key\-Press\-Event ({\bf QKey\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKColorDialog_b1}


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 {\bf KDialog\-Base} {\rm (p.\,\pageref{classKDialogBase_b0})}.

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
kcolordialog.h\end{CompactItemize}
