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

KDEUI

KEditListBox Class Reference

#include <keditlistbox.h>

Inheritance diagram for KEditListBox:

Inheritance graph
[legend]

List of all members.


Detailed Description

An editable listbox.

This class provides a editable listbox ;-), this means a listbox which is accompanied by a line edit to enter new items into the listbox and pushbuttons to add and remove items from the listbox and two buttons to move items up and down.

keditlistbox.png

KDE Edit List Box Widget

Definition at line 45 of file keditlistbox.h.


Public Types

enum  Button { Add = 0x0001, Remove = 0x0002, UpDown = 0x0004, All = Add | Remove | UpDown }

Signals

void added (const QString &text)
void changed ()
void removed (const QString &text)

Public Member Functions

QPushButton * addButton () const
Buttons buttons () const
bool checkAtEntering ()
void clear ()
int count () const
int currentItem () const
QString currentText () const
QPushButton * downButton () const
bool eventFilter (QObject *o, QEvent *e)
void insertItem (const QString &text, int index=-1)
void insertStringList (const QStringList &list, int index=-1)
QStringList items () const
 KEditListBox (const QString &title, const CustomEditor &customEditor, QWidget *parent=0, const char *name=0, bool checkAtEntering=false, Buttons buttons=All)
 KEditListBox (const QString &title, QWidget *parent, const char *name, bool checkAtEntering=false, Buttons buttons=All)
 KEditListBox (QWidget *parent, const char *name, bool checkAtEntering=false, Buttons buttons=All)
 KEditListBox (const QString &title, QWidget *parent=0)
 KEditListBox (QWidget *parent=0)
KLineEdit * lineEdit () const
QListView * listView () const
QPushButton * removeButton () const
void setButtons (Buttons buttons)
void setCheckAtEntering (bool check)
void setCustomEditor (const CustomEditor &editor)
void setItems (const QStringList &items)
QString text (int index) const
QPushButton * upButton () const
virtual ~KEditListBox ()

Protected Slots

void addItem ()
void enableMoveButtons (const QModelIndex &, const QModelIndex &)
void moveItemDown ()
void moveItemUp ()
void removeItem ()
void typedSomething (const QString &text)

Properties

Buttons buttons
QStringList items

Classes

class  CustomEditor
 Custom editor class. More...

Member Enumeration Documentation

enum KEditListBox::Button

Enumeration of the buttons, the listbox offers.

Specify them in the constructor in the buttons parameter, or in setButtons.

Enumerator:
Add 
Remove 
UpDown 
All 

Definition at line 86 of file keditlistbox.h.


Constructor & Destructor Documentation

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

Create an editable listbox.

Definition at line 233 of file keditlistbox.cpp.

KEditListBox::KEditListBox ( const QString &  title,
QWidget *  parent = 0 
) [explicit]

Create an editable listbox.

The same as the other constructor, additionally it takes title, which will be the title of the groupbox around the listbox.

Definition at line 239 of file keditlistbox.cpp.

KEditListBox::KEditListBox ( QWidget *  parent,
const char *  name,
bool  checkAtEntering = false,
Buttons  buttons = All 
) [explicit]

Create an editable listbox.

Deprecated:
If checkAtEntering is true, after every character you type in the line edit KEditListBox will enable or disable the Add-button, depending whether the current content of the line edit is already in the listbox. Maybe this can become a performance hit with large lists on slow machines. If checkAtEntering is false, it will be checked if you press the Add-button. It is not possible to enter items twice into the listbox.

Definition at line 245 of file keditlistbox.cpp.

KEditListBox::KEditListBox ( const QString &  title,
QWidget *  parent,
const char *  name,
bool  checkAtEntering = false,
Buttons  buttons = All 
) [explicit]

Create an editable listbox.

Deprecated:
The same as the other constructor, additionally it takes title, which will be the title of the frame around the listbox.

Definition at line 253 of file keditlistbox.cpp.

KEditListBox::KEditListBox ( const QString &  title,
const CustomEditor &  customEditor,
QWidget *  parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
Buttons  buttons = All 
)

Another constructor, which allows to use a custom editing widget instead of the standard KLineEdit widget.

E.g. you can use a KUrlRequester or a KComboBox as input widget. The custom editor must consist of a lineedit and optionally another widget that is used as representation. A KComboBox or a KUrlRequester have a KLineEdit as child-widget for example, so the KComboBox is used as the representation widget.

See also:
KUrlRequester::customEditor(), setCustomEditor

Definition at line 261 of file keditlistbox.cpp.

KEditListBox::~KEditListBox (  )  [virtual]

Definition at line 271 of file keditlistbox.cpp.


Member Function Documentation

QPushButton * KEditListBox::addButton (  )  const

Return a pointer to the Add button.

Definition at line 291 of file keditlistbox.cpp.

void KEditListBox::added ( const QString &  text  )  [signal]

This signal is emitted when the user adds a new string to the list, the parameter is the added string.

void KEditListBox::addItem (  )  [protected, slot]

Definition at line 471 of file keditlistbox.cpp.

Buttons KEditListBox::buttons (  )  const

Returns which buttons are visible.

void KEditListBox::changed (  )  [signal]

bool KEditListBox::checkAtEntering (  ) 

Returns true if check at entering is enabled.

Definition at line 372 of file keditlistbox.cpp.

void KEditListBox::clear (  ) 

Clears both the listbox and the line edit.

Definition at line 594 of file keditlistbox.cpp.

int KEditListBox::count (  )  const

See QListBox::count().

Definition at line 311 of file keditlistbox.cpp.

int KEditListBox::currentItem (  )  const

See QListBox::currentItem().

Definition at line 525 of file keditlistbox.cpp.

QString KEditListBox::currentText (  )  const

See QListBox::currentText().

Definition at line 632 of file keditlistbox.cpp.

QPushButton * KEditListBox::downButton (  )  const

Return a pointer to the Down button.

Definition at line 306 of file keditlistbox.cpp.

void KEditListBox::enableMoveButtons ( const QModelIndex &  newIndex,
const QModelIndex &   
) [protected, slot]

Definition at line 556 of file keditlistbox.cpp.

bool KEditListBox::eventFilter ( QObject *  o,
QEvent *  e 
)

Reimplented for interal reasons.

The API is not affected.

Definition at line 666 of file keditlistbox.cpp.

void KEditListBox::insertItem ( const QString &  text,
int  index = -1 
)

See QListBox::insertStrList().

Definition at line 613 of file keditlistbox.cpp.

void KEditListBox::insertStringList ( const QStringList &  list,
int  index = -1 
)

See QListBox::insertStringList().

Definition at line 601 of file keditlistbox.cpp.

QStringList KEditListBox::items (  )  const

Returns:
a stringlist of all items in the listbox

KLineEdit * KEditListBox::lineEdit (  )  const

Return a pointer to the embedded KLineEdit.

Definition at line 286 of file keditlistbox.cpp.

QListView * KEditListBox::listView (  )  const

Return a pointer to the embedded QListView.

Definition at line 281 of file keditlistbox.cpp.

void KEditListBox::moveItemDown (  )  [protected, slot]

Definition at line 443 of file keditlistbox.cpp.

void KEditListBox::moveItemUp (  )  [protected, slot]

Definition at line 415 of file keditlistbox.cpp.

QPushButton * KEditListBox::removeButton (  )  const

Return a pointer to the Remove button.

Definition at line 296 of file keditlistbox.cpp.

void KEditListBox::removed ( const QString &  text  )  [signal]

This signal is emitted when the user removes a string from the list, the parameter is the removed string.

void KEditListBox::removeItem (  )  [protected, slot]

Definition at line 534 of file keditlistbox.cpp.

void KEditListBox::setButtons ( Buttons  buttons  ) 

Specifies which buttons should be visible.

Definition at line 316 of file keditlistbox.cpp.

void KEditListBox::setCheckAtEntering ( bool  check  ) 

If check is true, after every character you type in the line edit KEditListBox will enable or disable the Add-button, depending whether the current content of the line edit is already in the listbox.

Maybe this can become a performance hit with large lists on slow machines. If check is false, it will be checked if you press the Add-button. It is not possible to enter items twice into the listbox. Default is false.

Definition at line 367 of file keditlistbox.cpp.

void KEditListBox::setCustomEditor ( const CustomEditor &  editor  ) 

Allows to use a custom editing widget instead of the standard KLineEdit widget.

E.g. you can use a KUrlRequester or a KComboBox as input widget. The custom editor must consist of a lineedit and optionally another widget that is used as representation. A KComboBox or a KUrlRequester have a KLineEdit as child-widget for example, so the KComboBox is used as the representation widget.

Since:
4.1

Definition at line 276 of file keditlistbox.cpp.

void KEditListBox::setItems ( const QStringList &  items  ) 

Clears the listbox and sets the contents to items.

Definition at line 646 of file keditlistbox.cpp.

QString KEditListBox::text ( int  index  )  const

See QListBox::text().

Definition at line 625 of file keditlistbox.cpp.

void KEditListBox::typedSomething ( const QString &  text  )  [protected, slot]

Definition at line 377 of file keditlistbox.cpp.

QPushButton * KEditListBox::upButton (  )  const

Return a pointer to the Up button.

Definition at line 301 of file keditlistbox.cpp.


Property Documentation

KEditListBox::Buttons KEditListBox::buttons [read, write]

Definition at line 50 of file keditlistbox.h.

QStringList KEditListBox::items [read, write]

Definition at line 51 of file keditlistbox.h.


The documentation for this class was generated from the following files:
  • keditlistbox.h
  • keditlistbox.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