class KColorDialog


Definition#include <kcolordialog.h>
InheritsKDialogBase
Annotated List
Files
Globals
Hierarchy
Index
Main

Public Methods

Public Slots

Signals

Public Static Methods


Detailed Description

The KColorDialog provides a dialog for color selection.

Features:

In most cases, you will want to use the static method KColorDialog::getColor(). This pops up the dialog (with an initial selection provided by you), lets the user choose a color, and returns.

Example:


 	QColor myColor;
 	int result = KColorDialog::getColor( myColor );
         if ( result == KColorDialog::Accepted )
            ...

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 KXYSelector. Right next to it is a KHSSelector for chosing hue/saturation.

On the right side of the dialog you see a KPaletteTable 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 KColorPatch.

 KColorDialog ( QWidget *parent = 0L, const char *name = 0L, bool modal = FALSE )

Construct a KColorDialog.

KColorDialog ()

QColor  color ()

Retrieve the currently selected color.

int  getColor ( QColor &theColor, QWidget *parent=0L )

[static]

Create a modal color dialog, let the user choose a color, and return when the dialog is closed.

The selected color is returned in the argument theColor.

Returns: QDialog::result().

QColor  grabColor (const QPoint &p)

[static]

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

void  setColor ( const QColor &col )

[slot]

Preselects a color.

void  colorSelected ( const QColor &col )

[signal]

Emitted when a color is selected. Connect to this to monitor the color as it as selected if you are not running modal.

private slots: void  slotRGBChanged ( void )

[signal]

void  slotHSVChanged ( void )

[signal]

void  slotHtmlChanged ( void )

[signal]

void  slotHSChanged ( int, int )

[signal]

void  slotVChanged ( int )

[signal]

void  slotColorSelected ( const QColor &col )

[signal]

void  slotColorSelected ( const QColor &col, const QString &name )

[signal]

void  slotColorPicker ()

[signal]

void  slotAddToCustomColors ()

[signal]

void  slotWriteSettings ()

[signal]

Write the settings of the dialog to config file.

private: /** * Read the settings for the dialog from config file. **/ void  readSettings ()

[signal]

void  setRgbEdit ( void )

[signal]

void  setHsvEdit ( void )

[signal]

void  setHtmlEdit ( void )

[signal]

void  _setColor ( const KColor &col, const QString &name=QString::null )

[signal]

protected: /** * @reimplemented */ void  mouseReleaseEvent ( QMouseEvent * )

[virtual signal]

void  keyPressEvent ( QKeyEvent * )

[virtual signal]

Reimplemented from KDialogBase for internal reasons; the API is not affected.