kdeui Library API Documentation

KNumInput Class Reference

You need to inherit from this class if you want to implement K*NumInput for a different variable type. More...

#include <knuminput.h>

Inheritance diagram for KNumInput:

QWidget KDoubleNumInput KIntNumInput List of all members.

Public Methods

 KNumInput (QWidget *parent=0, const char *name=0)
 Default constructor.

 KNumInput (KNumInput *below, QWidget *parent=0, const char *name=0)
virtual void setLabel (const QString &label, int a=AlignLeft|AlignTop)
 Sets the text and alignment of the main description label.

QString label () const
bool showSlider () const
void setSteps (int minor, int major)
 Sets the spacing of tickmarks for the slider.

QSizePolicy sizePolicy () const
 Specifies that this widget may stretch horizontally, but is fixed vertically (like QSpinBox itself).

virtual QSize sizeHint () const
 Returns a size which fits the contents of the control.


Protected Methods

void layout (bool deep)
 Call this function whenever you change something in the geometry of your KNumInput child.

virtual void doLayout ()=0
 You need to overwrite this method and implement your layout calculations there.


Detailed Description

You need to inherit from this class if you want to implement K*NumInput for a different variable type.

Definition at line 48 of file knuminput.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 60 of file knuminput.cpp.

KNumInput::KNumInput KNumInput *    below,
QWidget   parent = 0,
const char *    name = 0
 

Parameters:
below  A pointer to another KNumInput.

Definition at line 66 of file knuminput.cpp.

References m_next, and m_prev.


Member Function Documentation

void KNumInput::setLabel const QString   label,
int    a = AlignLeft|AlignTop
[virtual]
 

Sets the text and alignment of the main description label.

Parameters:
label  The text of the label. Use QString::null to remove an existing one.
a  one of AlignLeft, AlignHCenter, YAlignRight and AlignTop, AlignVCenter, AlignBottom. default is AlignLeft | AlignTop.
The vertical alignment flags have special meaning with this widget:

  • AlignTop The label is placed above the edit/slider
  • AlignVCenter The label is placed left beside the edit
  • AlignBottom The label is placed below the edit/slider

Reimplemented in KIntNumInput, and KDoubleNumInput.

Definition at line 99 of file knuminput.cpp.

References QString::isEmpty(), KStdAccel::label(), QWidget::layout(), QLabel::setAlignment(), and QLabel::setText().

Referenced by KDoubleNumInput::setLabel(), and KIntNumInput::setLabel().

QString KNumInput::label  
 

Returns:
the text of the label.

Definition at line 120 of file knuminput.cpp.

References QLabel::text().

bool KNumInput::showSlider   const [inline]
 

Returns:
if the num input has a slider.
Since:
3.1

Definition at line 95 of file knuminput.h.

void KNumInput::setSteps int    minor,
int    major
 

Sets the spacing of tickmarks for the slider.

Parameters:
minor  Minor tickmark separation.
major  Major tickmark separation.

Definition at line 193 of file knuminput.cpp.

QSizePolicy KNumInput::sizePolicy  
 

Specifies that this widget may stretch horizontally, but is fixed vertically (like QSpinBox itself).

Definition at line 183 of file knuminput.cpp.

QSize KNumInput::sizeHint   [virtual]
 

Returns a size which fits the contents of the control.

Returns:
the preferred size necessary to show the control

Reimplemented from QWidget.

Definition at line 188 of file knuminput.cpp.

References QWidget::minimumSizeHint().

void KNumInput::layout bool    deep [protected]
 

Call this function whenever you change something in the geometry of your KNumInput child.

Definition at line 126 of file knuminput.cpp.

References doLayout(), m_colw1, m_colw2, m_next, m_prev, and QSize::width().

virtual void KNumInput::doLayout   [protected, pure virtual]
 

You need to overwrite this method and implement your layout calculations there.

See KIntNumInput::doLayout and KDoubleNumInput::doLayout implementation for details.

Implemented in KIntNumInput, and KDoubleNumInput.

Referenced by layout().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:06 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001