KXYSelector Class Reference
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values. More...
#include <kselect.h>
Inheritance diagram for KXYSelector:


Signals | |
void | valueChanged (int x, int y) |
Public Member Functions | |
KXYSelector (QWidget *parent=0, const char *name=0) | |
~KXYSelector () | |
void | setValues (int xPos, int yPos) |
void | setXValue (int xPos) |
void | setYValue (int yPos) |
void | setRange (int minX, int minY, int maxX, int maxY) |
int | xValue () const |
int | yValue () const |
QRect | contentsRect () const |
Protected Member Functions | |
virtual void | drawContents (QPainter *) |
virtual void | drawCursor (QPainter *p, int xp, int yp) |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *) |
void | valuesFromPosition (int x, int y, int &xVal, int &yVal) const |
virtual void | virtual_hook (int id, void *data) |
Properties | |
int | xValue |
int | yValue |
Detailed Description
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimensional range of values.The currently chosen value is indicated by a cross. An example is the KHSSelector which allows to choose from a range of colors, and which is used in KColorDialog.
A custom drawing routine for the widget surface has to be provided by the subclass.
Definition at line 43 of file kselect.h.
Constructor & Destructor Documentation
|
Constructs a two-dimensional selector widget which has a value range of [0. .100] in both directions. Definition at line 35 of file kselect.cpp. References QPixmap::resize(), and QPixmap::setOptimization(). |
|
Destructs the widget.
Definition at line 49 of file kselect.cpp. |
Member Function Documentation
|
Sets the current values in horizontal and vertical direction.
Definition at line 73 of file kselect.cpp. References QWidget::height(), and QWidget::width(). Referenced by mouseMoveEvent(), mousePressEvent(), setXValue(), setYValue(), and wheelEvent(). |
|
Sets the current horizontal value.
Definition at line 63 of file kselect.cpp. References setValues(). |
|
Sets the current vertical value.
Definition at line 68 of file kselect.cpp. References setValues(). |
|
Sets the range of possible values.
Definition at line 53 of file kselect.cpp. Referenced by KHSSelector::KHSSelector(). |
|
Definition at line 88 of file kselect.h. Referenced by wheelEvent(). |
|
Definition at line 92 of file kselect.h. Referenced by wheelEvent(). |
|
Definition at line 94 of file kselect.cpp. References QWidget::height(), and QWidget::width(). Referenced by KHSSelector::drawContents(), and KHSSelector::drawPalette(). |
|
This signal is emitted whenever the user chooses a value, e.g. by clicking with the mouse on the widget. Referenced by mouseMoveEvent(), mousePressEvent(), and wheelEvent(). |
|
Override this function to draw the contents of the widget. The default implementation does nothing. Draw within contentsRect() only. Reimplemented in KHSSelector. Definition at line 196 of file kselect.cpp. Referenced by paintEvent(). |
|
Override this function to draw the cursor which indicates the currently selected value pair.
Definition at line 200 of file kselect.cpp. References QPainter::drawLine(), and QPainter::setPen(). Referenced by paintEvent(). |
|
Converts a pixel position to its corresponding values.
Definition at line 154 of file kselect.cpp. References QWidget::height(), and QWidget::width(). Referenced by mouseMoveEvent(), and mousePressEvent(). |
The documentation for this class was generated from the following files: