org.kde.koala

Class KColorDialog

public class KColorDialog extends KDialogBase

  • 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
  • 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 choosing 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. See KColorDialogSignals for signals emitted by KColorDialog

    UNKNOWN: A color selection dialog.

    Constructor Summary
    protected KColorDialog(Class dummy)
    KColorDialog(QWidget parent, String name, boolean modal)
    Constructs a color selection dialog.
    KColorDialog(QWidget parent, String name)
    KColorDialog(QWidget parent)
    KColorDialog()
    Method Summary
    StringclassName()
    QColorcolor()
    Returns the currently selected color.
    QColordefaultColor()
    voiddispose()
    Delete the wrapped C++ instance ahead of finalize()
    booleaneventFilter(QObject arg1, QEvent ev)
    protected voidfinalize()
    Deletes the wrapped C++ instance
    static intgetColor(QColor theColor, QWidget parent)
    Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed.
    static intgetColor(QColor theColor)
    static intgetColor(QColor theColor, QColor defaultColor, QWidget parent)
    Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed.
    static intgetColor(QColor theColor, QColor defaultColor)
    static QColorgrabColor(QPoint p)
    Gets the color from the pixel at point p on the screen.
    booleanisDisposed()
    Has the wrapped C++ instance been deleted?
    protected voidkeyPressEvent(QKeyEvent arg1)
    QMetaObjectmetaObject()
    protected voidmouseReleaseEvent(QMouseEvent arg1)
    voidsetColor(QColor col)
    Preselects a color.
    voidsetDefaultColor(QColor defaultCol)
    Call this to make the dialog show a "Default Color" checkbox.

    Constructor Detail

    KColorDialog

    protected KColorDialog(Class dummy)

    KColorDialog

    public KColorDialog(QWidget parent, String name, boolean modal)
    Constructs a color selection dialog.

    UNKNOWN: Constructs a color selection dialog.

    KColorDialog

    public KColorDialog(QWidget parent, String name)

    KColorDialog

    public KColorDialog(QWidget parent)

    KColorDialog

    public KColorDialog()

    Method Detail

    className

    public String className()

    color

    public QColor color()
    Returns the currently selected color.

    UNKNOWN: Returns the currently selected color.

    defaultColor

    public QColor defaultColor()

    Returns: the value passed to setDefaultColor

    UNKNOWN:

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    eventFilter

    public boolean eventFilter(QObject arg1, QEvent ev)

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    getColor

    public static int getColor(QColor theColor, QWidget parent)
    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.

    Returns: QDialog.result().

    UNKNOWN: Creates a modal color dialog, let the user choose a color, and returns when the dialog is closed.

    getColor

    public static int getColor(QColor theColor)

    getColor

    public static int getColor(QColor theColor, QColor defaultColor, QWidget parent)
    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.

    Returns: QDialog.result().

    UNKNOWN: Creates a modal color dialog, lets the user choose a color, and returns when the dialog is closed.

    getColor

    public static int getColor(QColor theColor, QColor defaultColor)

    grabColor

    public static QColor grabColor(QPoint p)
    Gets the color from the pixel at point p on the screen.

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

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    keyPressEvent

    protected void keyPressEvent(QKeyEvent arg1)

    metaObject

    public QMetaObject metaObject()

    mouseReleaseEvent

    protected void mouseReleaseEvent(QMouseEvent arg1)

    setColor

    public void setColor(QColor col)
    Preselects a color.

    UNKNOWN: Preselects a color.

    setDefaultColor

    public void setDefaultColor(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.

    UNKNOWN: Call this to make the dialog show a "Default Color" checkbox.