org.kde.koala
Class KDualColorButton
public
class
KDualColorButton
extends QWidget
KDualColorButton allows the user to select two cascaded colors (usually a
foreground and background color). Other features include drag and drop
from other KDE color widgets, a reset to black and white control, and a
swap colors control.
When the user clicks on the foreground or background rectangle the
rectangle is first sunken and the currentChanged() signal is emitted.
Further clicks will present a color dialog and emit either the fgChanged()
or bgChanged() if a new color is selected.
Note: With drag and drop when dropping a color the current selected color
will be set, while when dragging a color it will use whatever color
rectangle the mouse was pressed inside.
\image html kdualcolorbutton.png "KDE Dual Color Button"
See
KDualColorButtonSignals for signals emitted by KDualColorButton
Author: Daniel M. Duley
UNKNOWN: A widget for selecting two related colors.
Constructor Summary |
protected | KDualColorButton(Class dummy) |
| KDualColorButton(QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton using the default black and white
colors. |
| KDualColorButton(QWidget parent, String name) |
| KDualColorButton(QWidget parent) |
| KDualColorButton() |
| KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton with the supplied foreground and
background colors. |
| KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name) |
| KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent) |
| KDualColorButton(QColor fgColor, QColor bgColor) |
Method Summary |
QColor | background()
Returns the current background color. |
String | className() |
int | current()
Returns the current color item selected by the user. |
QColor | currentColor()
Returns the color of the selected item. |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | dragEnterEvent(QDragEnterEvent ev) |
protected void | dropEvent(QDropEvent ev) |
protected void | finalize() Deletes the wrapped C++ instance |
QColor | foreground()
Returns the current foreground color. |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
QMetaObject | metaObject() |
protected void | metrics(QRect fgRect, QRect bgRect)
Sets the supplied rectangles to the proper size and position for the
current widget size. |
protected void | mouseMoveEvent(QMouseEvent ev) |
protected void | mousePressEvent(QMouseEvent ev) |
protected void | mouseReleaseEvent(QMouseEvent ev) |
protected void | paintEvent(QPaintEvent ev) |
void | setBackground(QColor c)
Sets the background color. |
void | setCurrent(int s)
Sets the current selected color item. |
void | setCurrentColor(QColor c)
Sets the color of the selected item. |
void | setForeground(QColor c)
Sets the foreground color. |
QSize | sizeHint()
Returns the minimum size needed to display the widget and all its
controls. |
public static final int Background
public static final int Foreground
protected KDualColorButton(Class dummy)
public KDualColorButton(QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton using the default black and white
colors.
UNKNOWN: Constructs a new KDualColorButton using the default black and white colors.
public KDualColorButton(QWidget parent, String name)
public KDualColorButton(QWidget parent)
public KDualColorButton()
public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name, QWidget dialogParent)
Constructs a new KDualColorButton with the supplied foreground and
background colors.
UNKNOWN: Constructs a new KDualColorButton with the supplied foreground and background colors.
public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent, String name)
public KDualColorButton(QColor fgColor, QColor bgColor, QWidget parent)
public KDualColorButton(QColor fgColor, QColor bgColor)
public QColor background()
Returns the current background color.
UNKNOWN: Returns the current background color.
public String className()
public int current()
Returns the current color item selected by the user.
UNKNOWN: Returns the current color item selected by the user.
public QColor currentColor()
Returns the color of the selected item.
UNKNOWN: Returns the color of the selected item.
public void dispose()
Delete the wrapped C++ instance ahead of finalize()
protected void dragEnterEvent(QDragEnterEvent ev)
protected void dropEvent(QDropEvent ev)
protected void finalize()
Deletes the wrapped C++ instance
public QColor foreground()
Returns the current foreground color.
UNKNOWN: Returns the current foreground color.
public boolean isDisposed()
Has the wrapped C++ instance been deleted?
public QMetaObject metaObject()
protected void metrics(QRect fgRect, QRect bgRect)
Sets the supplied rectangles to the proper size and position for the
current widget size. You can reimplement this to change the layout
of the widget. Restrictions are that the swap control will always
be at the top right, the reset control will always be at the bottom
left, and you must leave at least a 14x14 space in those corners.
UNKNOWN: Sets the supplied rectangles to the proper size and position for the current widget size.
protected void mouseMoveEvent(QMouseEvent ev)
protected void mousePressEvent(QMouseEvent ev)
protected void mouseReleaseEvent(QMouseEvent ev)
protected void paintEvent(QPaintEvent ev)
public void setBackground(QColor c)
Sets the background color.
UNKNOWN: Sets the background color.
public void setCurrent(int s)
Sets the current selected color item.
UNKNOWN: Sets the current selected color item.
public void setCurrentColor(QColor c)
Sets the color of the selected item.
UNKNOWN: Sets the color of the selected item.
public void setForeground(QColor c)
Sets the foreground color.
UNKNOWN: Sets the foreground color.
public QSize sizeHint()
Returns the minimum size needed to display the widget and all its
controls.
UNKNOWN: Returns the minimum size needed to display the widget and all its controls.