Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QColorDialog Class Reference

The QColorDialog class provides a dialog widget for specifying colors. More...

#include </home/clem/local/src/opie/libqtaux/qcolordialog.h>

Collaboration diagram for QColorDialog:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static QColor getColor (QColor, QWidget *parent=0, const char *name=0)
static QRgb getRgba (QRgb, bool *ok=0, QWidget *parent=0, const char *name=0)
static int customCount ()
static QRgb customColor (int)
static void setCustomColor (int, QRgb)

Private Member Functions

 ~QColorDialog ()
 QColorDialog (QWidget *parent=0, const char *name=0, bool modal=FALSE)
void setColor (QColor)
QColor color () const
void setSelectedAlpha (int)
int selectedAlpha () const
void showCustom (bool=TRUE)

Private Attributes

QColorDialogPrivated

Friends

class QColorDialogPrivate

Detailed Description

The QColorDialog class provides a dialog widget for specifying colors.

The color dialog's function is to allow users to choose colors - for instance, you might use this in a drawing program to allow the user to set the brush color.

This version of Qt only provides modal color dialogs. The static getColor() function shows the dialog and allows the user to specify a color, while getRgba() does the same but allows the user to specify a color with an alpha channel (transparency) value.

The user can store customCount() different custom colors. The custom colors are shared by all color dialogs, and remembered during the execution of the program. Use setCustomColor() to set the custom colors, and customColor() to get them.

qcolordlg-m.png
qcolordlg-w.png

Definition at line 47 of file qcolordialog.h.


Constructor & Destructor Documentation

QColorDialog::~QColorDialog  )  [private]
 

Destructs the dialog and frees any memory it allocated.

Definition at line 1592 of file qcolordialog.cpp.

QColorDialog::QColorDialog QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE
[private]
 

Constructs a default color dialog. Use setColor() for setting an initial value.

See also:
getColor()

Definition at line 1501 of file qcolordialog.cpp.

References d, QColorDialogPrivate, and TRUE.

Referenced by getColor(), and getRgba().


Member Function Documentation

QColor QColorDialog::color  )  const [private]
 

Returns the color currently selected in the dialog.

See also:
setColor()

Definition at line 1582 of file qcolordialog.cpp.

References QColorDialogPrivate::currentColor(), and d.

Referenced by getColor(), and getRgba().

QRgb QColorDialog::customColor int  i  )  [static]
 

Returns custom color number i as a QRgb.

Definition at line 537 of file qcolordialog.cpp.

References cusrgb, customCount(), initRGB(), and qWarning().

int QColorDialog::customCount  )  [static]
 

Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors.

Definition at line 529 of file qcolordialog.cpp.

Referenced by customColor(), and setCustomColor().

QColor QColorDialog::getColor QColor  initial,
QWidget *  parent = 0,
const char *  name = 0
[static]
 

Pops up a modal color dialog letting the user choose a color and returns that color. The color is initially set to initial. Returns an invalid color if the user cancels the dialog. All colors allocated by the dialog will be deallocated before this function returns.

Definition at line 1516 of file qcolordialog.cpp.

References color(), qApp, QColorDialog(), setColor(), tr, and TRUE.

Referenced by KColorButton::chooseColor(), ConfigDlg::keyColorClicked(), ConfigDlg::keyColorLinesClicked(), ConfigDlg::keyColorPressedClicked(), and ConfigDlg::textColorClicked().

QRgb QColorDialog::getRgba QRgb  initial,
bool *  ok = 0,
QWidget *  parent = 0,
const char *  name = 0
[static]
 

Pops up a modal color dialog, letting the user choose a color and an alpha channel value. The color+alpha is initially set to initial.

If ok is non-null, *ok is set to TRUE if the user clicked OK, and FALSE if the user clicked Cancel.

If the user clicks Cancel the initial value is returned.

Definition at line 1549 of file qcolordialog.cpp.

References alpha, color(), QColorDialog(), selectedAlpha(), setColor(), setSelectedAlpha(), and TRUE.

int QColorDialog::selectedAlpha  )  const [private]
 

Returns the value selected for the alpha channel.

Definition at line 1628 of file qcolordialog.cpp.

References QColorDialogPrivate::currentAlpha(), and d.

Referenced by getRgba().

void QColorDialog::setColor QColor  c  )  [private]
 

Sets the color shown in the dialog to c.

See also:
color()

Definition at line 1604 of file qcolordialog.cpp.

References d, and QColorDialogPrivate::setCurrentColor().

Referenced by getColor(), and getRgba().

void QColorDialog::setCustomColor int  i,
QRgb  c
[static]
 

Sets custom color number i to the QRgb value c.

Definition at line 552 of file qcolordialog.cpp.

References cusrgb, customCount(), initRGB(), and qWarning().

void QColorDialog::setSelectedAlpha int  a  )  [private]
 

Sets the initial alpha channel value to a, and show the alpha channel entry box.

Definition at line 1617 of file qcolordialog.cpp.

References d, QColorDialogPrivate::setCurrentAlpha(), QColorDialogPrivate::showAlpha(), and TRUE.

Referenced by getRgba().

void QColorDialog::showCustom bool  = TRUE  )  [private]
 


Friends And Related Function Documentation

friend class QColorDialogPrivate [friend]
 

Definition at line 75 of file qcolordialog.h.

Referenced by QColorDialog().


Member Data Documentation

QColorDialogPrivate* QColorDialog::d [private]
 

Definition at line 74 of file qcolordialog.h.

Referenced by color(), QColorDialog(), selectedAlpha(), setColor(), and setSelectedAlpha().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:46:15 2005 for OPIE by  doxygen 1.4.2