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

KDEUI

KNumInput Class Reference

#include <knuminput.h>

Inheritance diagram for KNumInput:

Inheritance graph
[legend]

List of all members.


Detailed Description

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

Definition at line 42 of file knuminput.h.


Public Member Functions

KDE_CONSTRUCTOR_DEPRECATED KNumInput (QWidget *parent, KNumInput *below)
 KNumInput (QWidget *parent=0)
QString label () const
virtual void setLabel (const QString &label, Qt::Alignment a=Qt::AlignLeft|Qt::AlignTop)
void setSteps (int minor, int major)
bool showSlider () const
virtual QSize sizeHint () const
 ~KNumInput ()

Protected Member Functions

virtual void doLayout ()=0
void layout (bool deep)
QSlider * slider () const

Properties

QString label

Constructor & Destructor Documentation

KNumInput::KNumInput ( QWidget *  parent = 0  )  [explicit]

Default constructor.

Parameters:
parent If parent is 0, the new widget becomes a top-level window. If parent is another widget, this widget becomes a child window inside parent. The new widget is deleted when its parent is deleted.

Definition at line 92 of file knuminput.cpp.

KNumInput::KNumInput ( QWidget *  parent,
KNumInput *  below 
)

Parameters:
below A pointer to another KNumInput.

Parameters:
parent parent widget
Deprecated:
  • use the version without the below parameter instead

Definition at line 98 of file knuminput.cpp.

KNumInput::~KNumInput (  ) 

Destructor.

Definition at line 104 of file knuminput.cpp.


Member Function Documentation

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.

QString KNumInput::label (  )  const

Returns:
the text of the label.

void KNumInput::layout ( bool  deep  )  [protected]

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

Definition at line 152 of file knuminput.cpp.

void KNumInput::setLabel ( const QString &  label,
Qt::Alignment  a = Qt::AlignLeft | Qt::AlignTop 
) [virtual]

Sets the text and alignment of the main description label.

Parameters:
label The text of the label. Use QString() to remove an existing one.
a The alignment of the label (Qt::Alignment). Default is Qt:AlignLeft | Qt:AlignTop.
The vertical alignment flags have special meaning with this widget:

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

Reimplemented in KIntNumInput, and KDoubleNumInput.

Definition at line 125 of file knuminput.cpp.

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 214 of file knuminput.cpp.

bool KNumInput::showSlider (  )  const

Returns:
if the num input has a slider.

Definition at line 120 of file knuminput.cpp.

QSize KNumInput::sizeHint ( void   )  const [virtual]

Returns a size which fits the contents of the control.

Returns:
the preferred size necessary to show the control

Definition at line 209 of file knuminput.cpp.

QSlider * KNumInput::slider (  )  const [protected]

Returns:
the slider widget.

For internal use only.

Definition at line 115 of file knuminput.cpp.


Property Documentation

QString KNumInput::label [read, write]

Definition at line 45 of file knuminput.h.


The documentation for this class was generated from the following files:
  • knuminput.h
  • knuminput.cpp

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal