• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KXYSelector Class Reference

#include <kxyselector.h>

Inheritance diagram for KXYSelector:
Inheritance graph
[legend]

Signals

void valueChanged (int x, int y)
 

Public Member Functions

 KXYSelector (QWidget *parent=0)
 
 ~KXYSelector ()
 
QRect contentsRect () const
 
virtual QSize minimumSizeHint () const
 
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
 

Protected Member Functions

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

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 39 of file kxyselector.h.

Constructor & Destructor Documentation

KXYSelector::KXYSelector ( QWidget *  parent = 0)
explicit

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

Definition at line 61 of file kxyselector.cpp.

KXYSelector::~KXYSelector ( )

Destructs the widget.

Definition at line 68 of file kxyselector.cpp.

Member Function Documentation

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

Definition at line 150 of file kxyselector.cpp.

void KXYSelector::drawContents ( QPainter *  )
protectedvirtual

Override this function to draw the contents of the widget.

The default implementation does nothing.

Draw within contentsRect() only.

Reimplemented in KHueSaturationSelector.

Definition at line 241 of file kxyselector.cpp.

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

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

Definition at line 245 of file kxyselector.cpp.

QSize KXYSelector::minimumSizeHint ( ) const
virtual

Reimplemented to give the widget a minimum size.

Definition at line 156 of file kxyselector.cpp.

void KXYSelector::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

Definition at line 183 of file kxyselector.cpp.

void KXYSelector::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Definition at line 178 of file kxyselector.cpp.

void KXYSelector::paintEvent ( QPaintEvent *  e)
protectedvirtual

Definition at line 162 of file kxyselector.cpp.

void KXYSelector::setMarkerColor ( const QColor &  col)

Sets the color used to draw the marker.

Parameters
colthe color

Definition at line 145 of file kxyselector.cpp.

void KXYSelector::setRange ( int  minX,
int  minY,
int  maxX,
int  maxY 
)

Sets the range of possible values.

Definition at line 83 of file kxyselector.cpp.

void KXYSelector::setValues ( int  xPos,
int  yPos 
)

Sets the current values in horizontal and vertical direction.

Parameters
xPosthe horizontal value
yPosthe vertical value

Definition at line 114 of file kxyselector.cpp.

void KXYSelector::setXValue ( int  xPos)

Sets the current horizontal value.

Parameters
xPosthe horizontal value

Definition at line 104 of file kxyselector.cpp.

void KXYSelector::setYValue ( int  yPos)

Sets the current vertical value.

Parameters
yPosthe vertical value

Definition at line 109 of file kxyselector.cpp.

void KXYSelector::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.

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

Converts a pixel position to its corresponding values.

Definition at line 203 of file kxyselector.cpp.

void KXYSelector::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Definition at line 193 of file kxyselector.cpp.

int KXYSelector::xValue ( ) const
Returns
the current value in horizontal direction.
int KXYSelector::yValue ( ) const
Returns
the current value in vertical direction.

Property Documentation

int KXYSelector::xValue
readwrite

Definition at line 42 of file kxyselector.h.

int KXYSelector::yValue
readwrite

Definition at line 43 of file kxyselector.h.


The documentation for this class was generated from the following files:
  • kxyselector.h
  • kxyselector.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal