digiKam
Digikam::DHueSaturationSelector Class Reference
+ Inheritance diagram for Digikam::DHueSaturationSelector:

Signals

void valueChanged (int x, int y)
 

Public Member Functions

DColorChooserMode chooserMode () const
 
int colorValue () const
 
QRect contentsRect () const
 
 DHueSaturationSelector (QWidget *const parent=nullptr)
 
int hue () const
 
QSize minimumSizeHint () const override
 
int saturation () const
 
void setChooserMode (DColorChooserMode chooserMode)
 
void setColorValue (int color)
 
void setHue (int hue)
 
void setMarkerColor (const QColor &col)
 
void setRange (int minX, int minY, int maxX, int maxY)
 
void setSaturation (int saturation)
 
void setValues (int xPos, int yPos)
 
void setXValue (int xPos)
 
void setYValue (int yPos)
 
void updateContents ()
 
int xValue () const
 
int yValue () const
 
 ~DHueSaturationSelector () override
 

Protected Member Functions

void drawContents (QPainter *painter) override
 
virtual void drawMarker (QPainter *p, int xp, int yp)
 
virtual void drawPalette (QPixmap *pixmap)
 
void mouseMoveEvent (QMouseEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void paintEvent (QPaintEvent *e) override
 
void resizeEvent (QResizeEvent *) override
 
void valuesFromPosition (int x, int y, int &xVal, int &yVal) const
 
void wheelEvent (QWheelEvent *) override
 

Properties

int xValue
 
int yValue
 

Friends

class Private
 

Constructor & Destructor Documentation

◆ DHueSaturationSelector()

Digikam::DHueSaturationSelector::DHueSaturationSelector ( QWidget *const  parent = nullptr)
explicit

Constructs a hue/saturation selection widget.

References Digikam::ChooserClassic, and setChooserMode().

◆ ~DHueSaturationSelector()

Digikam::DHueSaturationSelector::~DHueSaturationSelector ( )
override

Destructor.

Member Function Documentation

◆ chooserMode()

DColorChooserMode Digikam::DHueSaturationSelector::chooserMode ( ) const

Returns the chooser mode.

Returns
The chooser mode (defined in DColorChooserMode)

Referenced by drawPalette(), and setChooserMode().

◆ colorValue()

int Digikam::DHueSaturationSelector::colorValue ( ) const

Returns the color value (also known as luminosity, 0-255)

Returns
The color value (0-255)

Referenced by drawPalette().

◆ contentsRect()

QRect Digikam::DPointSelect::contentsRect ( ) const
inherited
Returns
the rectangle on which subclasses should draw.

Referenced by drawContents(), and drawPalette().

◆ drawContents()

void Digikam::DHueSaturationSelector::drawContents ( QPainter *  painter)
overrideprotectedvirtual

Reimplemented from DPointSelect. This drawing is buffered in a pixmap here. As real drawing routine, drawPalette() is used.

Reimplemented from Digikam::DPointSelect.

References Digikam::DPointSelect::contentsRect().

◆ drawMarker()

void Digikam::DPointSelect::drawMarker ( QPainter *  p,
int  xp,
int  yp 
)
protectedvirtualinherited

Override this function to draw the marker which indicates the currently selected value pair.

Referenced by Digikam::DPointSelect::paintEvent().

◆ drawPalette()

void Digikam::DHueSaturationSelector::drawPalette ( QPixmap *  pixmap)
protectedvirtual

Draws the contents of the widget on a pixmap, which is used for buffering.

References Digikam::ChooserClassic, chooserMode(), colorValue(), Digikam::DPointSelect::contentsRect(), hue(), and saturation().

Referenced by updateContents().

◆ hue()

int Digikam::DHueSaturationSelector::hue ( ) const

Returns the hue value

Returns
The hue value (0-360)

Referenced by Digikam::FuzzySearchView::doLoadState(), Digikam::FuzzySearchView::doSaveState(), drawPalette(), and setHue().

◆ minimumSizeHint()

QSize Digikam::DPointSelect::minimumSizeHint ( ) const
overrideinherited

Reimplemented to give the widget a minimum size

◆ mouseMoveEvent()

void Digikam::DPointSelect::mouseMoveEvent ( QMouseEvent *  e)
overrideprotectedinherited

◆ mousePressEvent()

void Digikam::DPointSelect::mousePressEvent ( QMouseEvent *  e)
overrideprotectedinherited

◆ paintEvent()

void Digikam::DPointSelect::paintEvent ( QPaintEvent *  e)
overrideprotectedinherited

◆ resizeEvent()

void Digikam::DHueSaturationSelector::resizeEvent ( QResizeEvent *  )
overrideprotected

References updateContents().

◆ saturation()

int Digikam::DHueSaturationSelector::saturation ( ) const

Returns the saturation (0-255)

Returns
The saturation (0-255)

Referenced by Digikam::FuzzySearchView::doLoadState(), Digikam::FuzzySearchView::doSaveState(), drawPalette(), and setSaturation().

◆ setChooserMode()

void Digikam::DHueSaturationSelector::setChooserMode ( DColorChooserMode  chooserMode)

Sets the chooser mode. The allowed modes are defined in DColorChooserMode.

Parameters
Thechooser mode as defined in DColorChooserMode

References chooserMode(), Digikam::ChooserSaturation, Digikam::ChooserValue, and Digikam::DPointSelect::setRange().

Referenced by DHueSaturationSelector().

◆ setColorValue()

void Digikam::DHueSaturationSelector::setColorValue ( int  color)

Sets the color value (0-255)

Parameters
colorValueThe color value (0-255)

◆ setHue()

void Digikam::DHueSaturationSelector::setHue ( int  hue)

Sets the hue value (0-360)

Parameters
hueThe hue value (0-360)

References hue().

Referenced by Digikam::FuzzySearchView::doLoadState().

◆ setMarkerColor()

void Digikam::DPointSelect::setMarkerColor ( const QColor &  col)
inherited

Sets the color used to draw the marker

Parameters
colthe color

◆ setRange()

void Digikam::DPointSelect::setRange ( int  minX,
int  minY,
int  maxX,
int  maxY 
)
inherited

Sets the range of possible values.

Referenced by setChooserMode().

◆ setSaturation()

void Digikam::DHueSaturationSelector::setSaturation ( int  saturation)

Sets the saturation (0-255)

Parameters
saturationThe saturation (0-255)

References saturation().

Referenced by Digikam::FuzzySearchView::doLoadState().

◆ setValues()

void Digikam::DPointSelect::setValues ( int  xPos,
int  yPos 
)
inherited

Sets the current values in horizontal and vertical direction.

Parameters
xPosthe horizontal value
yPosthe vertical value

Referenced by Digikam::DPointSelect::mouseMoveEvent(), Digikam::DPointSelect::setXValue(), Digikam::DPointSelect::setYValue(), and Digikam::DPointSelect::wheelEvent().

◆ setXValue()

void Digikam::DPointSelect::setXValue ( int  xPos)
inherited

Sets the current horizontal value

Parameters
xPosthe horizontal value

References Digikam::DPointSelect::setValues().

◆ setYValue()

void Digikam::DPointSelect::setYValue ( int  yPos)
inherited

Sets the current vertical value

Parameters
yPosthe vertical value

References Digikam::DPointSelect::setValues().

◆ updateContents()

void Digikam::DHueSaturationSelector::updateContents ( )

Updates the contents

References drawPalette().

Referenced by Digikam::FuzzySearchView::doLoadState(), and resizeEvent().

◆ valueChanged

void Digikam::DPointSelect::valueChanged ( int  x,
int  y 
)
signalinherited

This signal is emitted whenever the user chooses a value, e.g. by clicking with the mouse on the widget.

Referenced by Digikam::DPointSelect::mouseMoveEvent(), and Digikam::DPointSelect::wheelEvent().

◆ valuesFromPosition()

void Digikam::DPointSelect::valuesFromPosition ( int  x,
int  y,
int &  xVal,
int &  yVal 
) const
protectedinherited

Converts a pixel position to its corresponding values.

Referenced by Digikam::DPointSelect::mouseMoveEvent().

◆ wheelEvent()

void Digikam::DPointSelect::wheelEvent ( QWheelEvent *  e)
overrideprotectedinherited

◆ xValue()

int Digikam::DPointSelect::xValue ( ) const
inherited
Returns
the current value in horizontal direction.

◆ yValue()

int Digikam::DPointSelect::yValue ( ) const
inherited
Returns
the current value in vertical direction.

Friends And Related Function Documentation

◆ Private

friend class Private
friend

Property Documentation

◆ xValue

int Digikam::DPointSelect::xValue
readwriteinherited

◆ yValue

int Digikam::DPointSelect::yValue
readwriteinherited

The documentation for this class was generated from the following files: