KDEUI
KColorDialog Class Reference
#include <kcolordialog.h>

Detailed Description
A color selection dialog.
Features:
- Color selection from a wide range of palettes.
- Color selection from a palette of H vs S and V selectors.
- Direct input of HSV or RGB values.
- Saving of custom colors
Example:
QColor myColor; int result = KColorDialog::getColor( myColor ); if ( result == KColorDialog::Accepted ) ...

KDE Color Dialog
On the right side of the dialog you see a KColorTable showing a number of 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.
Definition at line 171 of file kcolordialog.h.
Public Slots | |
void | setColor (const QColor &col) |
Signals | |
void | colorSelected (const QColor &col) |
Public Member Functions | |
QColor | color () const |
QColor | defaultColor () const |
KColorDialog (QWidget *parent=0L, bool modal=false) | |
void | setDefaultColor (const QColor &defaultCol) |
~KColorDialog () | |
Static Public Member Functions | |
static int | getColor (QColor &theColor, const QColor &defaultColor, QWidget *parent=0L) |
static int | getColor (QColor &theColor, QWidget *parent=0L) |
static QColor | grabColor (const QPoint &p) |
Protected Member Functions | |
virtual bool | eventFilter (QObject *obj, QEvent *ev) |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | mouseMoveEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
Constructor & Destructor Documentation
KColorDialog::~KColorDialog | ( | ) |
Member Function Documentation
QColor KColorDialog::color | ( | ) | const |
void KColorDialog::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.
QColor KColorDialog::defaultColor | ( | ) | const |
Definition at line 1216 of file kcolordialog.cpp.
int KColorDialog::getColor | ( | QColor & | theColor, | |
const QColor & | defaultColor, | |||
QWidget * | parent = 0L | |||
) | [static] |
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 theColor
.
This version takes a defaultColor
argument, which sets the color selected by the "default color" checkbox. When this checkbox is checked, the invalid color (QColor()) is returned into theColor
.
- Parameters:
-
theColor if valid, specifies the color to be initially selected. On return, holds the selected color. defaultColor color selected by the "default color" checkbox
- Returns:
- QDialog::result().
Definition at line 1431 of file kcolordialog.cpp.
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 theColor
.
- Parameters:
-
theColor if valid, specifies the color to be initially selected. On return, holds the selected color.
- Returns:
- QDialog::result().
Definition at line 1413 of file kcolordialog.cpp.
Gets the color from the pixel at point p on the screen.
Definition at line 1733 of file kcolordialog.cpp.
void KColorDialog::keyPressEvent | ( | QKeyEvent * | event | ) | [protected, virtual] |
For internal use only.
Reimplemented from KDialog.
Definition at line 1760 of file kcolordialog.cpp.
void KColorDialog::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Read the settings for the dialog from config file.
Definition at line 1705 of file kcolordialog.cpp.
void KColorDialog::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Definition at line 1716 of file kcolordialog.cpp.
void KColorDialog::setColor | ( | const QColor & | col | ) | [slot] |
void KColorDialog::setDefaultColor | ( | const QColor & | defaultCol | ) |
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 KDE text color on screen, but black when printing.
Definition at line 1234 of file kcolordialog.cpp.
The documentation for this class was generated from the following files: