kdeui Library API Documentation

KGradientSelector Class Reference

The KGradientSelector widget allows the user to choose from a one-dimensional range of colors which is given as a gradient between two colors provided by the programmer. More...

#include <kselect.h>

Inheritance diagram for KGradientSelector:

KSelector QWidget QRangeControl List of all members.

Public Member Functions

 KGradientSelector (QWidget *parent=0, const char *name=0)
 KGradientSelector (Orientation o, QWidget *parent=0, const char *name=0)
 ~KGradientSelector ()
void setColors (const QColor &col1, const QColor &col2)
void setText (const QString &t1, const QString &t2)
void setFirstColor (const QColor &col)
void setSecondColor (const QColor &col)
void setFirstText (const QString &t)
void setSecondText (const QString &t)
const QColor firstColor () const
const QColor secondColor () const
const QString firstText () const
const QString secondText () const

Protected Member Functions

virtual void drawContents (QPainter *)
virtual QSize minimumSize () const
virtual void virtual_hook (int id, void *data)

Properties

QColor firstColor
QColor secondColor
QString firstText
QString secondText

Detailed Description

The KGradientSelector widget allows the user to choose from a one-dimensional range of colors which is given as a gradient between two colors provided by the programmer.

kgradientselector.png

KDE Gradient Selector Widget

Definition at line 274 of file kselect.h.


Constructor & Destructor Documentation

KGradientSelector::KGradientSelector QWidget parent = 0,
const char *  name = 0
 

Constructs a horizontal color selector which contains a gradient between white and black.

Definition at line 369 of file kselect.cpp.

References KGradientSelector().

Referenced by KGradientSelector().

KGradientSelector::KGradientSelector Orientation  o,
QWidget parent = 0,
const char *  name = 0
 

Constructs a colors selector with orientation o which contains a gradient between white and black.

Definition at line 376 of file kselect.cpp.

References KGradientSelector().

KGradientSelector::~KGradientSelector  ) 
 

Destructs the widget.

Definition at line 384 of file kselect.cpp.


Member Function Documentation

void KGradientSelector::setColors const QColor col1,
const QColor col2
[inline]
 

Sets the two colors which span the gradient.

Definition at line 301 of file kselect.h.

References QWidget::update().

void KGradientSelector::setFirstColor const QColor col  )  [inline]
 

Set each color on its own.

Definition at line 309 of file kselect.h.

References QWidget::update().

void KGradientSelector::setFirstText const QString t  )  [inline]
 

Set each description on its own.

Definition at line 317 of file kselect.h.

References QWidget::update().

void KGradientSelector::drawContents QPainter  )  [protected, virtual]
 

Override this function to draw the contents of the control.

The default implementation does nothing.

Draw only within contentsRect().

Reimplemented from KSelector.

Definition at line 397 of file kselect.cpp.

References QColor::blue(), QRect::bottom(), KSelector::contentsRect(), QPixmap::convertFromImage(), drawContents(), QPainter::drawPixmap(), QPainter::drawText(), QPainter::fontMetrics(), QColor::green(), QImage::height(), QWidget::height(), QRect::left(), KSelector::orientation(), QColor::red(), QColor::rgb(), QImage::scanLine(), QPen::setColor(), QPainter::setPen(), QColor::setRgb(), QRect::top(), QRect::width(), QImage::width(), QWidget::width(), QWidget::x(), and QWidget::y().

Referenced by drawContents().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 16 17:22:05 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003