Hue-Saturation chart selector class. More...
This class describes the Hue-Saturation chart as often found in the color selection dialogs. In combination with QValueSelector it can be used to select a color from the HSV space.
It behaves as any QRangeControl but with two degrees of freedom. Therefore it contains the following signal/slot pairs:
NOTE: Despite behaviour similarities, this class derives only from QLabel, not from QRangeControl.
Constructor.
This method constructs the HS selection widget with given parent and name. The widget is always 180 pixels wide and 128 pixels high and it contains the image with colors changing in Hue from 0 to 359 and in Saturation from 0 to 255. In addition, the Value of the colors changes from 128 to 255 so that even low saturated colors don't blend into indidtinguishable darkness.
Destructor.
This destructor does nothing. The Qt framework takes care of all cleanup.
Returns the hue value.
Returns the saturation value.
[slot]
Set the hue value of selector.
This function validates the value of the parameter h, sets iHue to it and if the iHue has changed emits signal hueChanged(). It also calls update of the widget on the previous position of the cursor, so that the background is redrawn and a new cursor is painted appropriately.
[slot]
Set the saturation value of selector.
This function validates the value of the parameter s, sets iSaturation to it. If the iSaturation has changed emits signal saturationChanged(). It also calls update of the widget on the previous position of the cursor, so that the background is redrawn and a new cursor is painted appropriately.
[signal]
Emited when hue changed.
[signal]
Emited when saturation changed.
[protected, virtual]
Repaints the HS chart and draws the selection cross.
On repaint event, the default paintEvent() is called. In this way the color chart image is redrawn. Later the diagonal cross is painted in the position given by current iHue, iSaturation values.
[protected, virtual]
Used for user interaction.
This function simply calls setHue() and setSaturation() with appropriate values concerning the mouse position as described in mouse event.
[protected, virtual]
Used for user interaction.
As the result of pressing mouse button within HSSelector should be the same as dragging the mouse there, this function simply passes the event to mouseMoveEvent().
[protected]
Current hue value.
[protected]
Current saturation value.