KDevelop API Documentation

KDevCompat::KEditListBox Class Reference

An editable listbox. More...

#include <kdeveditlistbox.h>

Inheritance diagram for KDevCompat::KEditListBox:

QGroupBox List of all members.

Public Types

enum  Button { Add = 1, Remove = 2, UpDown = 4, All = Add|Remove|UpDown }
 Enumeration of the buttons, the listbox offers. More...


Signals

void changed ()

Public Member Functions

 KEditListBox (QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
 Create an editable listbox.

 KEditListBox (const QString &title, QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
 Create an editable listbox.

 KEditListBox (const QString &title, const CustomEditor &customEditor, QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
 Another constructor, which allows to use a custom editing widget instead of the standard KLineEdit widget.

virtual ~KEditListBox ()
QListBoxlistBox () const
 Return a pointer to the embedded QListBox.

KLineEditlineEdit () const
 Return a pointer to the embedded QLineEdit.

QPushButtonaddButton () const
 Return a pointer to the Add button.

QPushButtonremoveButton () const
 Return a pointer to the Remove button.

QPushButtonupButton () const
 Return a pointer to the Up button.

QPushButtondownButton () const
 Return a pointer to the Down button.

int count () const
 See QListBox::count().

void insertStringList (const QStringList &list, int index=-1)
 See QListBox::insertStringList().

void insertStrList (const QStrList *list, int index=-1)
 See QListBox::insertStringList().

void insertStrList (const QStrList &list, int index=-1)
 See QListBox::insertStrList().

void insertStrList (const char **list, int numStrings=-1, int index=-1)
 See QListBox::insertStrList().

void insertItem (const QString &text, int index=-1)
 See QListBox::insertItem().

void clear ()
 Clears both the listbox and the line edit.

QString text (int index) const
 See QListBox::text().

int currentItem () const
 See QListBox::currentItem().

QString currentText () const
 See QListBox::currentText().

QStringList items () const

Protected Slots

void moveItemUp ()
void moveItemDown ()
void addItem ()
void removeItem ()
void enableMoveButtons (int index)
void typedSomething (const QString &text)

Protected Member Functions

virtual void virtual_hook (int id, void *data)

Private Member Functions

void init (bool checkAtEntering, int buttons, QWidget *representationWidget=0L)

Private Attributes

QListBoxm_listBox
QPushButtonservUpButton
QPushButtonservDownButton
QPushButtonservNewButton
QPushButtonservRemoveButton
KLineEditm_lineEdit
KEditListBoxPrivated

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.

Definition at line 36 of file kdeveditlistbox.h.


Member Enumeration Documentation

enum KDevCompat::KEditListBox::Button
 

Enumeration of the buttons, the listbox offers.

Specify them in the constructor in the buttons parameter.

Enumeration values:
Add 
Remove 
UpDown 
All 

Definition at line 78 of file kdeveditlistbox.h.


Constructor & Destructor Documentation

KDevCompat::KEditListBox::KEditListBox QWidget parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  buttons = All
 

Create an editable listbox.

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 12 of file kdeveditlistbox.cpp.

References init().

KDevCompat::KEditListBox::KEditListBox const QString title,
QWidget parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  buttons = All
 

Create an editable listbox.

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

Definition at line 19 of file kdeveditlistbox.cpp.

References init().

KDevCompat::KEditListBox::KEditListBox const QString title,
const CustomEditor customEditor,
QWidget parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  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()
Since:
3.1

Definition at line 26 of file kdeveditlistbox.cpp.

References init(), KDevCompat::KEditListBox::CustomEditor::lineEdit(), m_lineEdit, and KDevCompat::KEditListBox::CustomEditor::representationWidget().

KDevCompat::KEditListBox::~KEditListBox  )  [virtual]
 

Definition at line 35 of file kdeveditlistbox.cpp.


Member Function Documentation

QPushButton* KDevCompat::KEditListBox::addButton  )  const [inline]
 

Return a pointer to the Add button.

Definition at line 134 of file kdeveditlistbox.h.

References servNewButton.

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

Definition at line 203 of file kdeveditlistbox.cpp.

References KEditListBox::changed(), and KEditListBox::currentItem().

void KDevCompat::KEditListBox::changed  )  [signal]
 

void KDevCompat::KEditListBox::clear  ) 
 

Clears both the listbox and the line edit.

Definition at line 306 of file kdeveditlistbox.cpp.

References KEditListBox::changed().

int KDevCompat::KEditListBox::count  )  const [inline]
 

See QListBox::count().

Definition at line 151 of file kdeveditlistbox.h.

References m_listBox.

int KDevCompat::KEditListBox::currentItem  )  const
 

See QListBox::currentItem().

Definition at line 246 of file kdeveditlistbox.cpp.

QString KDevCompat::KEditListBox::currentText  )  const [inline]
 

See QListBox::currentText().

Definition at line 187 of file kdeveditlistbox.h.

References m_listBox.

QPushButton* KDevCompat::KEditListBox::downButton  )  const [inline]
 

Return a pointer to the Down button.

Definition at line 146 of file kdeveditlistbox.h.

References servDownButton.

void KDevCompat::KEditListBox::enableMoveButtons int  index  )  [protected, slot]
 

Definition at line 270 of file kdeveditlistbox.cpp.

References KEditListBox::currentText().

void KDevCompat::KEditListBox::init bool  checkAtEntering,
int  buttons,
QWidget representationWidget = 0L
[private]
 

Definition at line 41 of file kdeveditlistbox.cpp.

References KEditListBox::addItem(), KEditListBox::moveItemDown(), KEditListBox::moveItemUp(), and KEditListBox::removeItem().

Referenced by KEditListBox().

void KDevCompat::KEditListBox::insertItem const QString text,
int  index = -1
[inline]
 

See QListBox::insertItem().

Definition at line 171 of file kdeveditlistbox.h.

References insertItem(), m_listBox, and text().

Referenced by insertItem().

void KDevCompat::KEditListBox::insertStringList const QStringList list,
int  index = -1
 

See QListBox::insertStringList().

Definition at line 313 of file kdeveditlistbox.cpp.

void KDevCompat::KEditListBox::insertStrList const char **  list,
int  numStrings = -1,
int  index = -1
 

See QListBox::insertStrList().

Definition at line 328 of file kdeveditlistbox.cpp.

void KDevCompat::KEditListBox::insertStrList const QStrList list,
int  index = -1
 

See QListBox::insertStrList().

Definition at line 323 of file kdeveditlistbox.cpp.

void KDevCompat::KEditListBox::insertStrList const QStrList list,
int  index = -1
 

See QListBox::insertStringList().

Definition at line 318 of file kdeveditlistbox.cpp.

QStringList KDevCompat::KEditListBox::items  )  const
 

Returns:
a stringlist of all items in the listbox

Definition at line 333 of file kdeveditlistbox.cpp.

KLineEdit* KDevCompat::KEditListBox::lineEdit  )  const [inline]
 

Return a pointer to the embedded QLineEdit.

Definition at line 130 of file kdeveditlistbox.h.

References m_lineEdit.

QListBox* KDevCompat::KEditListBox::listBox  )  const [inline]
 

Return a pointer to the embedded QListBox.

Definition at line 126 of file kdeveditlistbox.h.

References m_listBox.

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

Definition at line 180 of file kdeveditlistbox.cpp.

References KNotifyClient::beep(), and KEditListBox::changed().

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

Definition at line 157 of file kdeveditlistbox.cpp.

References KNotifyClient::beep(), and KEditListBox::changed().

QPushButton* KDevCompat::KEditListBox::removeButton  )  const [inline]
 

Return a pointer to the Remove button.

Definition at line 138 of file kdeveditlistbox.h.

References servRemoveButton.

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

Definition at line 253 of file kdeveditlistbox.cpp.

References KEditListBox::changed(), and KEditListBox::count().

QString KDevCompat::KEditListBox::text int  index  )  const [inline]
 

See QListBox::text().

Definition at line 179 of file kdeveditlistbox.h.

References m_listBox.

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

Definition at line 121 of file kdeveditlistbox.cpp.

References KEditListBox::changed(), KEditListBox::currentItem(), KEditListBox::currentText(), and text().

QPushButton* KDevCompat::KEditListBox::upButton  )  const [inline]
 

Return a pointer to the Up button.

Definition at line 142 of file kdeveditlistbox.h.

References servUpButton.

void KDevCompat::KEditListBox::virtual_hook int  id,
void *  data
[protected, virtual]
 

Definition at line 342 of file kdeveditlistbox.cpp.


Member Data Documentation

KEditListBoxPrivate* KDevCompat::KEditListBox::d [private]
 

Definition at line 220 of file kdeveditlistbox.h.

KLineEdit* KDevCompat::KEditListBox::m_lineEdit [private]
 

Definition at line 210 of file kdeveditlistbox.h.

Referenced by KEditListBox(), and lineEdit().

QListBox* KDevCompat::KEditListBox::m_listBox [private]
 

Definition at line 207 of file kdeveditlistbox.h.

Referenced by count(), currentText(), insertItem(), listBox(), and text().

QPushButton * KDevCompat::KEditListBox::servDownButton [private]
 

Definition at line 208 of file kdeveditlistbox.h.

Referenced by downButton().

QPushButton* KDevCompat::KEditListBox::servNewButton [private]
 

Definition at line 209 of file kdeveditlistbox.h.

Referenced by addButton().

QPushButton * KDevCompat::KEditListBox::servRemoveButton [private]
 

Definition at line 209 of file kdeveditlistbox.h.

Referenced by removeButton().

QPushButton* KDevCompat::KEditListBox::servUpButton [private]
 

Definition at line 208 of file kdeveditlistbox.h.

Referenced by upButton().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:09 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003