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

kdeui

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:

Inheritance graph
[legend]

List of all members.


Public Member Functions

 KNumInput (KNumInput *below, QWidget *parent=0, const char *name=0)
 KNumInput (QWidget *parent=0, const char *name=0)
QString label () const
virtual void setLabel (const QString &label, int a=AlignLeft|AlignTop)
void setSteps (int minor, int major)
bool showSlider () const
virtual QSize sizeHint () const
QSizePolicy sizePolicy () const
 ~KNumInput ()

Protected Member Functions

virtual void doLayout ()=0
void layout (bool deep)
virtual void virtual_hook (int id, void *data)

Protected Attributes

int m_alignment
int m_colw1
int m_colw2
QLabel * m_label
KNumInput * m_next
KNumInput * m_prev
QSize m_sizeLabel
QSize m_sizeSlider
QSlider * m_slider

Properties

QString label

Detailed Description

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

Definition at line 49 of file knuminput.h.


Constructor & Destructor Documentation

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

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.
name The name is sent to the QObject constructor.

Definition at line 62 of file knuminput.cpp.

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

Parameters:
below A pointer to another KNumInput.
parent parent widget
name name of the widget

Definition at line 68 of file knuminput.cpp.

KNumInput::~KNumInput (  ) 

Definition at line 92 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 128 of file knuminput.cpp.

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

bool KNumInput::showSlider (  )  const [inline]

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

Definition at line 98 of file knuminput.h.

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

Reimplemented from QWidget.

Definition at line 190 of file knuminput.cpp.

QSizePolicy KNumInput::sizePolicy (  )  const

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

Reimplemented from QWidget.

Definition at line 185 of file knuminput.cpp.

void KNumInput::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Reimplemented in KIntNumInput, and KDoubleNumInput.

Definition at line 1165 of file knuminput.cpp.


Member Data Documentation

int KNumInput::m_alignment [protected]

Definition at line 146 of file knuminput.h.

int KNumInput::m_colw1 [protected]

Definition at line 140 of file knuminput.h.

int KNumInput::m_colw2 [protected]

Definition at line 140 of file knuminput.h.

QLabel* KNumInput::m_label [protected]

Definition at line 142 of file knuminput.h.

KNumInput * KNumInput::m_next [protected]

Definition at line 139 of file knuminput.h.

KNumInput* KNumInput::m_prev [protected]

Definition at line 139 of file knuminput.h.

QSize KNumInput::m_sizeLabel [protected]

Definition at line 144 of file knuminput.h.

QSize KNumInput::m_sizeSlider [protected]

Definition at line 144 of file knuminput.h.

QSlider* KNumInput::m_slider [protected]

Definition at line 143 of file knuminput.h.


Property Documentation

QString KNumInput::label [read, write]

Definition at line 52 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
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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