ColorPicker Class Reference

A widget that allows the user to select a color. More...

#include <colorpicker.h>

List of all members.

Public Slots

void setCol (int h, int s)
 Slot that is called when the color of the selected key in the mapping canvas changes.
void setCol (const QColor &c)
 Slot that is called when the color of the selected key in the mapping canvas changes.

Signals

void newCol (int h, int s)
 This signal is emitted when the color was changed by the user.
void toggleInteractionMode (bool b)
 This signal is emitted when the user changes the color.

Public Member Functions

 ColorPicker (QWidget *parent=0)
 Constructor.
 ~ColorPicker ()
 Destructor.

Protected Member Functions

void paintEvent (QPaintEvent *event)
 Paints a rect with all selectable colors and a black cross that is centered at the current selected color.
void mouseMoveEvent (QMouseEvent *event)
 Sets the current color to the color at the clicked position.
void mousePressEvent (QMouseEvent *event)
 Sets the current color to the color at the clicked position.
void mouseReleaseEvent (QMouseEvent *event)
 Only emits the toggleInteractionMode signal, so that coarseness mode is siwtched off.

Detailed Description

A widget that allows the user to select a color.

Therefore a rect with all possible colors and a cross indicating the current selected color are drawn. You can change the current color by a click on the desired color.

Definition at line 44 of file colorpicker.h.


Constructor & Destructor Documentation

ColorPicker ( QWidget *  parent = 0  ) 

Constructor.

Parameters:
parent the parent widget

Definition at line 37 of file colorpicker.cpp.


Member Function Documentation

void mouseMoveEvent ( QMouseEvent *  event  )  [protected]

Sets the current color to the color at the clicked position.

The center of the black cross is also set to this position.

Parameters:
event the mouse event

Definition at line 93 of file colorpicker.cpp.

void mousePressEvent ( QMouseEvent *  event  )  [protected]

Sets the current color to the color at the clicked position.

The center of the black cross is also set to this position.

Parameters:
event the mouse event

Definition at line 99 of file colorpicker.cpp.

void mouseReleaseEvent ( QMouseEvent *  event  )  [protected]

Only emits the toggleInteractionMode signal, so that coarseness mode is siwtched off.

Parameters:
event the mouse event

Definition at line 106 of file colorpicker.cpp.

void paintEvent ( QPaintEvent *  event  )  [protected]

Paints a rect with all selectable colors and a black cross that is centered at the current selected color.

Parameters:
event the paint event

Definition at line 111 of file colorpicker.cpp.

void setCol ( const QColor &  c  )  [slot]

Slot that is called when the color of the selected key in the mapping canvas changes.

Parameters:
c new color

Definition at line 89 of file colorpicker.cpp.

void setCol ( int  h,
int  s 
) [slot]

Slot that is called when the color of the selected key in the mapping canvas changes.

Parameters:
h new hue value
s new saturation value

Definition at line 76 of file colorpicker.cpp.

void toggleInteractionMode ( bool  b  )  [signal]

This signal is emitted when the user changes the color.

It will switch the coarseness mode of volume rendering on and off.

Parameters:
on should coarseness mode switched on or off?