KXYSelector Class Reference
from PyKDE4.kdeui import *
Inherits: QWidget → QObject
Subclasses: KHueSaturationSelector
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.
| 
 Signals | 
|  | valueChanged (int x, int y) | 
| 
 Methods | 
|  | __init__ (self, QWidget parent=0) | 
|  | __init__ (self, KXYSelector a0) | 
| QRect | contentsRect (self) | 
|  | drawContents (self, QPainter a0) | 
|  | drawMarker (self, QPainter p, int xp, int yp) | 
| QSize | minimumSizeHint (self) | 
|  | mouseMoveEvent (self, QMouseEvent e) | 
|  | mousePressEvent (self, QMouseEvent e) | 
|  | paintEvent (self, QPaintEvent e) | 
|  | setMarkerColor (self, QColor col) | 
|  | setRange (self, int minX, int minY, int maxX, int maxY) | 
|  | setValues (self, int xPos, int yPos) | 
|  | setXValue (self, int xPos) | 
|  | setYValue (self, int yPos) | 
| int xVal, int yVal | valuesFromPosition (self, int x, int y) | 
|  | wheelEvent (self, QWheelEvent a0) | 
| int | xValue (self) | 
| int | yValue (self) | 
Signal Documentation
| valueChanged | ( | int | x, | 
|  |  | int | y | 
|  | ) |  |  |  | 
 
This signal is emitted whenever the user chooses a value,
e.g. by clicking with the mouse on the widget.
- Signal syntax:
- QObject.connect(source, SIGNAL("valueChanged(int, int)"), target_slot)
 
Method Documentation
| __init__ | ( | self, |  | 
|  |  | QWidget | parent=0 | 
|  | ) |  |  |  | 
 
Constructs a two-dimensional selector widget which
has a value range of [0..100] in both directions.
 
| QRect contentsRect | ( |  | self ) |  | 
 
- Returns:
-  the rectangle on which subclasses should draw.
 
Override this function to draw the contents of the widget.
The default implementation does nothing.
Draw within contentsRect() only.
 
| drawMarker | ( | self, |  | 
|  |  | QPainter | p, | 
|  |  | int | xp, | 
|  |  | int | yp | 
|  | ) |  |  |  | 
 
Override this function to draw the marker which
indicates the currently selected value pair.
 
| QSize minimumSizeHint | ( |  | self ) |  | 
 
Reimplemented to give the widget a minimum size
 
| setMarkerColor | ( | self, |  | 
|  |  | QColor | col | 
|  | ) |  |  |  | 
 
Sets the color used to draw the marker
- Parameters:
- 
 
| setRange | ( | self, |  | 
|  |  | int | minX, | 
|  |  | int | minY, | 
|  |  | int | maxX, | 
|  |  | int | maxY | 
|  | ) |  |  |  | 
 
Sets the range of possible values.
 
| setValues | ( | self, |  | 
|  |  | int | xPos, | 
|  |  | int | yPos | 
|  | ) |  |  |  | 
 
Sets the current values in horizontal and
vertical direction.
- Parameters:
- 
|  | xPos | the horizontal value |  |  | yPos | the vertical value |  
 
 
| setXValue | ( | self, |  | 
|  |  | int | xPos | 
|  | ) |  |  |  | 
 
Sets the current horizontal value
- Parameters:
- 
|  | xPos | the horizontal value |  
 
 
| setYValue | ( | self, |  | 
|  |  | int | yPos | 
|  | ) |  |  |  | 
 
Sets the current vertical value
- Parameters:
- 
 
| int xVal, int yVal valuesFromPosition | ( | self, |  | 
|  |  | int | x, | 
|  |  | int | y | 
|  | ) |  |  |  | 
 
Converts a pixel position to its corresponding values.
 
- Returns:
-  the current value in horizontal direction.
 
- Returns:
-  the current value in vertical direction.