# class KXYSelector

###

Module | kdeui
Namespace |
Class | KXYSelector
Inherits | QWidget

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.

### methods

- KXYSelector (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

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

- KXYSelector (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KXYSelector |

- KXYSelector (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- contentsRect ( )

  returns QRect

  Returns the rectangle on which subclasses should draw.

- drawContents (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | QPainter |

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

  Draw within contentsRect() only.

- drawMarker (p, xp, yp)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  p | QPainter |
  xp | int |
  yp | int |

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

- minimumSizeHint ( )

  returns QSize

  Reimplemented to give the widget a minimum size

- mouseMoveEvent (e)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e | QMouseEvent |

- mousePressEvent (e)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e | QMouseEvent |

- paintEvent (e)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e | QPaintEvent |

- setMarkerColor (col)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  col | QColor |

  Sets the color used to draw the marker

  col - the color

- setRange (minX, minY, maxX, maxY)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  minX | int |
  minY | int |
  maxX | int |
  maxY | int |

  Sets the range of possible values.

- setValues (xPos, yPos)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  xPos | int |
  yPos | int |

  Sets the current values in horizontal and vertical direction.

  xPos - the horizontal value

  yPos - the vertical value

- setXValue (xPos)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  xPos | int |

  Sets the current horizontal value

  xPos - the horizontal value

- setYValue (yPos)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  yPos | int |

  Sets the current vertical value

  yPos - the vertical value

- valueChanged (x, y)

  returns Nothing
  SIGNAL ("valueChanged (int, int)")

  Argument | Type | Default
  --- | --- | ---
  x | int |
  y | int |

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

- valuesFromPosition (x, y)

  returns Nothing, int (xVal), int (yVal)

  Argument | Type | Default
  --- | --- | ---
  x | int |
  y | int |

  Converts a pixel position to its corresponding values.

- wheelEvent (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | QWheelEvent |

- xValue ( )

  returns int

  Returns the current value in horizontal direction.

- yValue ( )

  returns int

  Returns the current value in vertical direction.