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

Signals

void valueChanged (int x, int y)
 

Public Member Functions

QRect contentsRect () const
 
 DPointSelect (QWidget *const parent)
 
QSize minimumSizeHint () const override
 
void setMarkerColor (const QColor &col)
 
void setRange (int minX, int minY, int maxX, int maxY)
 
void setValues (int xPos, int yPos)
 
void setXValue (int xPos)
 
void setYValue (int yPos)
 
int xValue () const
 
int yValue () const
 
 ~DPointSelect () override
 

Protected Member Functions

virtual void drawContents (QPainter *)
 
virtual void drawMarker (QPainter *p, int xp, int yp)
 
void mouseMoveEvent (QMouseEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void paintEvent (QPaintEvent *e) 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

◆ DPointSelect()

Digikam::DPointSelect::DPointSelect ( QWidget *const  parent)
explicit

Constructs a two-dimensional selector widget which has a value range of [0..100] in both directions.

◆ ~DPointSelect()

Digikam::DPointSelect::~DPointSelect ( )
override

Member Function Documentation

◆ contentsRect()

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

Referenced by Digikam::DHueSaturationSelector::drawContents(), and Digikam::DHueSaturationSelector::drawPalette().

◆ drawContents()

virtual void Digikam::DPointSelect::drawContents ( QPainter *  )
inlineprotectedvirtual

Override this function to draw the contents of the widget. The default implementation does nothing.

Draw within contentsRect() only.

Reimplemented in Digikam::DHueSaturationSelector.

Referenced by paintEvent().

◆ drawMarker()

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

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

Referenced by paintEvent().

◆ minimumSizeHint()

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

Reimplemented to give the widget a minimum size

◆ mouseMoveEvent()

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

◆ mousePressEvent()

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

References mouseMoveEvent().

◆ paintEvent()

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

References drawContents(), and drawMarker().

◆ setMarkerColor()

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

Sets the color used to draw the marker

Parameters
colthe color

◆ setRange()

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

Sets the range of possible values.

Referenced by Digikam::DHueSaturationSelector::setChooserMode().

◆ setValues()

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

Sets the current values in horizontal and vertical direction.

Parameters
xPosthe horizontal value
yPosthe vertical value

Referenced by mouseMoveEvent(), setXValue(), setYValue(), and wheelEvent().

◆ setXValue()

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

Sets the current horizontal value

Parameters
xPosthe horizontal value

References setValues().

◆ setYValue()

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

Sets the current vertical value

Parameters
yPosthe vertical value

References setValues().

◆ valueChanged

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

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

Referenced by mouseMoveEvent(), and wheelEvent().

◆ valuesFromPosition()

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

Converts a pixel position to its corresponding values.

Referenced by mouseMoveEvent().

◆ wheelEvent()

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

◆ xValue()

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

◆ yValue()

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

Friends And Related Function Documentation

◆ Private

friend class Private
friend

Property Documentation

◆ xValue

int Digikam::DPointSelect::xValue
readwrite

Referenced by wheelEvent().

◆ yValue

int Digikam::DPointSelect::yValue
readwrite

Referenced by wheelEvent().


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