KDEUI
#include <keditlistwidget.h>
Classes | |
| class | CustomEditor |
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 | |
| KEditListWidget (const CustomEditor &customEditor, QWidget *parent=0, bool checkAtEntering=false, Buttons buttons=All) | |
| KEditListWidget (QWidget *parent=0) | |
| virtual | ~KEditListWidget () |
| 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 |
| 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 |
Properties | |
| Buttons | buttons |
| bool | checkAtEntering |
| QStringList | items |
Detailed Description
An editable listbox.
This class provides an 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.
- Since
- 4.6
Definition at line 48 of file keditlistwidget.h.
Member Enumeration Documentation
◆ 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 90 of file keditlistwidget.h.
Constructor & Destructor Documentation
◆ KEditListWidget() [1/2]
|
explicit |
Create an editable listbox.
Definition at line 239 of file keditlistwidget.cpp.
◆ KEditListWidget() [2/2]
| KEditListWidget::KEditListWidget | ( | const CustomEditor & | customEditor, |
| QWidget * | parent = 0, | ||
| bool | checkAtEntering = false, | ||
| Buttons | buttons = All ) |
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 245 of file keditlistwidget.cpp.
◆ ~KEditListWidget()
|
virtual |
Definition at line 255 of file keditlistwidget.cpp.
Member Function Documentation
◆ addButton()
| QPushButton * KEditListWidget::addButton | ( | ) | const |
Return a pointer to the Add button.
Definition at line 275 of file keditlistwidget.cpp.
◆ added
|
signal |
This signal is emitted when the user adds a new string to the list, the parameter is the added string.
◆ buttons()
| KEditListWidget::Buttons KEditListWidget::buttons | ( | ) | const |
Returns which buttons are visible.
Definition at line 639 of file keditlistwidget.cpp.
◆ changed
|
signal |
◆ checkAtEntering()
| bool KEditListWidget::checkAtEntering | ( | ) |
Returns true if check at entering is enabled.
◆ clear()
| void KEditListWidget::clear | ( | ) |
Clears both the listbox and the line edit.
Definition at line 582 of file keditlistwidget.cpp.
◆ count()
| int KEditListWidget::count | ( | ) | const |
See Q3ListBox::count().
Definition at line 295 of file keditlistwidget.cpp.
◆ currentItem()
| int KEditListWidget::currentItem | ( | ) | const |
See Q3ListBox::currentItem().
Definition at line 513 of file keditlistwidget.cpp.
◆ currentText()
| QString KEditListWidget::currentText | ( | ) | const |
See Q3ListBox::currentText().
Definition at line 620 of file keditlistwidget.cpp.
◆ downButton()
| QPushButton * KEditListWidget::downButton | ( | ) | const |
Return a pointer to the Down button.
Definition at line 290 of file keditlistwidget.cpp.
◆ eventFilter()
| bool KEditListWidget::eventFilter | ( | QObject * | o, |
| QEvent * | e ) |
Reimplented for interal reasons.
The API is not affected.
Definition at line 654 of file keditlistwidget.cpp.
◆ insertItem()
| void KEditListWidget::insertItem | ( | const QString & | text, |
| int | index = -1 ) |
See Q3ListBox::insertItem().
Definition at line 601 of file keditlistwidget.cpp.
◆ insertStringList()
| void KEditListWidget::insertStringList | ( | const QStringList & | list, |
| int | index = -1 ) |
See Q3ListBox::insertStringList().
Definition at line 589 of file keditlistwidget.cpp.
◆ items()
| QStringList KEditListWidget::items | ( | ) | const |
- Returns
- a stringlist of all items in the listbox
Definition at line 629 of file keditlistwidget.cpp.
◆ lineEdit()
| KLineEdit * KEditListWidget::lineEdit | ( | ) | const |
Return a pointer to the embedded KLineEdit.
Definition at line 270 of file keditlistwidget.cpp.
◆ listView()
| QListView * KEditListWidget::listView | ( | ) | const |
Return a pointer to the embedded QListView.
Definition at line 265 of file keditlistwidget.cpp.
◆ removeButton()
| QPushButton * KEditListWidget::removeButton | ( | ) | const |
Return a pointer to the Remove button.
Definition at line 280 of file keditlistwidget.cpp.
◆ removed
|
signal |
This signal is emitted when the user removes a string from the list, the parameter is the removed string.
◆ setButtons()
| void KEditListWidget::setButtons | ( | Buttons | buttons | ) |
Specifies which buttons should be visible.
Definition at line 300 of file keditlistwidget.cpp.
◆ setCheckAtEntering()
| void KEditListWidget::setCheckAtEntering | ( | bool | check | ) |
If check is true, after every character you type in the line edit KEditListWidget 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 350 of file keditlistwidget.cpp.
◆ setCustomEditor()
| void KEditListWidget::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.
Definition at line 260 of file keditlistwidget.cpp.
◆ setItems()
| void KEditListWidget::setItems | ( | const QStringList & | items | ) |
Clears the listbox and sets the contents to items.
Definition at line 634 of file keditlistwidget.cpp.
◆ text()
| QString KEditListWidget::text | ( | int | index | ) | const |
See Q3ListBox::text().
Definition at line 613 of file keditlistwidget.cpp.
◆ upButton()
| QPushButton * KEditListWidget::upButton | ( | ) | const |
Return a pointer to the Up button.
Definition at line 285 of file keditlistwidget.cpp.
Property Documentation
◆ buttons
|
readwrite |
Definition at line 53 of file keditlistwidget.h.
◆ checkAtEntering
|
readwrite |
Definition at line 55 of file keditlistwidget.h.
◆ items
|
readwrite |
Definition at line 54 of file keditlistwidget.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2026 The KDE developers.
Generated on by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.