Référence de la classe KoDualColorButton

A widget for selecting two related colors. Plus de détails...

#include <KoDualColorButton.h>

Graphe de collaboration de KoDualColorButton:

[légende]
Liste de tous les membres

Types publics

enum  Selection { Foreground, Background }

Connecteurs publics

void setForegroundColor (const KoColor &color)
void setBackgroundColor (const KoColor &color)
void setPopDialog (bool popDialog)

Signaux

void foregroundColorChanged (const KoColor &color)
void backgroundColorChanged (const KoColor &color)
void pleasePopDialog (const KoColor &color)

Fonctions membres publiques

 KoDualColorButton (QWidget *parent=0, QWidget *dialogParent=0)
 KoDualColorButton (const KoColor &foregroundColor, const KoColor &backgroundColor, QWidget *parent=0, QWidget *dialogParent=0)
 ~KoDualColorButton ()
KoColor foregroundColor () const
KoColor backgroundColor () const
bool popDialog () const
virtual QSize sizeHint () const

Fonctions membres protégées

virtual void metrics (QRect &foregroundRect, QRect &backgroundRect)
virtual void paintEvent (QPaintEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void mouseMoveEvent (QMouseEvent *event)
virtual void mouseReleaseEvent (QMouseEvent *event)
virtual void dragEnterEvent (QDragEnterEvent *event)
virtual void dropEvent (QDropEvent *event)

Propriétés

KoColor foregroundColor []
KoColor backgroundColor []
bool popDialog []

Attributs privés

Private *const d

Classes

class  Private

Description détaillée

A widget for selecting two related colors.

KoDualColorButton 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 selectionChanged() signal is emitted. Further clicks will present a color dialog and emit either the foregroundColorChanged() or backgroundColorChanged() 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.

Auteur:
Daniel M. Duley <mosfet@kde.org>

Définition à la ligne 48 du fichier KoDualColorButton.h.


Documentation des énumérations membres

enum KoDualColorButton::Selection

Valeurs énumérées:
Foreground 
Background 

Définition à la ligne 58 du fichier KoDualColorButton.h.


Documentation des contructeurs et destructeur

KoDualColorButton::KoDualColorButton ( QWidget *  parent = 0,
QWidget *  dialogParent = 0 
) [explicit]

Constructs a new KoDualColorButton using the default black and white colors.

Paramètres:
parent The parent widget of the KoDualColorButton.
dialogParent The parent widget of the color selection dialog.

KoDualColorButton::KoDualColorButton ( const KoColor foregroundColor,
const KoColor backgroundColor,
QWidget *  parent = 0,
QWidget *  dialogParent = 0 
)

Constructs a new KoDualColorButton with the supplied foreground and background colors.

Paramètres:
parent The parent widget of the KoDualColorButton.
dialogParent The parent widget of the color selection dialog.

Définition à la ligne 65 du fichier KoDualColorButton.cpp.

Références d, KoDualColorButton::Private::dialogParent, et sizeHint().

Voici le graphe d'appel pour cette fonction :

KoDualColorButton::~KoDualColorButton (  ) 

Destroys the KoDualColorButton.

Définition à la ligne 77 du fichier KoDualColorButton.cpp.

Références d.


Documentation des fonctions membres

KoColor KoDualColorButton::foregroundColor (  )  const

Returns the current foreground color.

KoColor KoDualColorButton::backgroundColor (  )  const

Returns the current background color.

bool KoDualColorButton::popDialog (  )  const

Returns if a dialog with a KoUniColorChooser will be popped up when clicking If false then you could/should connect to the pleasePopDialog signal and pop your own dialog. Just set the current color afterwards.

QSize KoDualColorButton::sizeHint (  )  const [virtual]

Returns the minimum size needed to display the widget and all its controls.

Définition à la ligne 97 du fichier KoDualColorButton.cpp.

Référencé par KoDualColorButton().

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::setForegroundColor ( const KoColor color  )  [slot]

Sets the foreground color.

Définition à la ligne 102 du fichier KoDualColorButton.cpp.

Références d, et KoDualColorButton::Private::foregroundColor.

void KoDualColorButton::setBackgroundColor ( const KoColor color  )  [slot]

Sets the background color.

Définition à la ligne 108 du fichier KoDualColorButton.cpp.

Références KoDualColorButton::Private::backgroundColor, et d.

void KoDualColorButton::setPopDialog ( bool  popDialog  )  [slot]

Sets if a dialog with a KoUniColorChooser should be popped up when clicking If you set this to false then you could connect to the pleasePopDialog signal and pop your own dialog. Just set the current color afterwards.

Définition à la ligne 114 du fichier KoDualColorButton.cpp.

Références d, et KoDualColorButton::Private::popDialog.

void KoDualColorButton::foregroundColorChanged ( const KoColor color  )  [signal]

Emitted when the foreground color is changed.

Référencé par mousePressEvent(), et mouseReleaseEvent().

void KoDualColorButton::backgroundColorChanged ( const KoColor color  )  [signal]

Emitted when the background color is changed.

Référencé par mousePressEvent(), et mouseReleaseEvent().

void KoDualColorButton::pleasePopDialog ( const KoColor color  )  [signal]

Emitted when the user clicks one of the two color patches. You should/could pop you own color chooser dialog in response. Also see the popDialog attribute.

Référencé par mouseReleaseEvent().

void KoDualColorButton::metrics ( QRect &  foregroundRect,
QRect &  backgroundRect 
) [protected, virtual]

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.

Définition à la ligne 119 du fichier KoDualColorButton.cpp.

Références KoPageFormat::height(), et KoPageFormat::width().

Référencé par mousePressEvent(), mouseReleaseEvent(), et paintEvent().

Voici le graphe d'appel pour cette fonction :

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

Définition à la ligne 125 du fichier KoDualColorButton.cpp.

Références KoDualColorButton::Private::arrowBitmap, KoDualColorButton::Private::backgroundColor, d, KoDualColorButton::Private::foregroundColor, metrics(), KoDualColorButton::Private::resetPixmap, et KoColor::toQColor().

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::mousePressEvent ( QMouseEvent *  event  )  [protected, virtual]

Définition à la ligne 173 du fichier KoDualColorButton.cpp.

Références Background, KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), d, KoDualColorButton::Private::dragFlag, KoDualColorButton::Private::dragPosition, Foreground, KoDualColorButton::Private::foregroundColor, foregroundColorChanged(), metrics(), KoDualColorButton::Private::miniCtlFlag, et KoDualColorButton::Private::tmpSelection.

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::mouseMoveEvent ( QMouseEvent *  event  )  [protected, virtual]

Définition à la ligne 207 du fichier KoDualColorButton.cpp.

Références KoDualColorButton::Private::backgroundColor, d, KoDualColorButton::Private::dragFlag, KoDualColorButton::Private::dragPosition, Foreground, KoDualColorButton::Private::foregroundColor, KoDualColorButton::Private::miniCtlFlag, KoDualColorButton::Private::tmpSelection, et KoColor::toQColor().

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::mouseReleaseEvent ( QMouseEvent *  event  )  [protected, virtual]

Définition à la ligne 222 du fichier KoDualColorButton.cpp.

Références Background, KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), d, testguiqt::dialog, KoDualColorButton::Private::dialogParent, KoDualColorButton::Private::dragFlag, Foreground, KoDualColorButton::Private::foregroundColor, foregroundColorChanged(), metrics(), KoDualColorButton::Private::miniCtlFlag, pleasePopDialog(), KoDualColorButton::Private::popDialog, et KoDualColorButton::Private::tmpSelection.

Voici le graphe d'appel pour cette fonction :

void KoDualColorButton::dragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

Définition à la ligne 150 du fichier KoDualColorButton.cpp.

void KoDualColorButton::dropEvent ( QDropEvent *  event  )  [protected, virtual]

Définition à la ligne 155 du fichier KoDualColorButton.cpp.


Documentation des données membres

Private* const KoDualColorButton::d [private]

Définition à la ligne 164 du fichier KoDualColorButton.h.

Référencé par KoDualColorButton(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintEvent(), setBackgroundColor(), setForegroundColor(), setPopDialog(), et ~KoDualColorButton().


Documentation des propriétés

KoColor KoDualColorButton::foregroundColor [read, write]

Définition à la ligne 52 du fichier KoDualColorButton.h.

KoColor KoDualColorButton::backgroundColor [read, write]

Définition à la ligne 53 du fichier KoDualColorButton.h.

bool KoDualColorButton::popDialog [read, write]

Définition à la ligne 54 du fichier KoDualColorButton.h.


La documentation de cette classe a été générée à partir des fichiers suivants :
Généré le Wed Nov 22 23:45:16 2006 pour KPlato par  doxygen 1.5.1-p1