KDEUI
#include <keditlistbox.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 | |
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 (const QString &title, QWidget *parent=0) | |
KEditListBox (QWidget *parent, const char *name, bool checkAtEntering=false, Buttons buttons=All) | |
KEditListBox (QWidget *parent=0) | |
virtual | ~KEditListBox () |
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 |
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 |
Detailed Description
An editable listbox.
- Deprecated:
- in favor of KEditListWidget embedded in a QGroupBox.
Definition at line 39 of file keditlistbox.h.
Member Enumeration Documentation
◆ Button
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 80 of file keditlistbox.h.
Constructor & Destructor Documentation
◆ KEditListBox() [1/5]
|
explicit |
Create an editable listbox.
Definition at line 237 of file keditlistbox.cpp.
◆ KEditListBox() [2/5]
|
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 243 of file keditlistbox.cpp.
◆ KEditListBox() [3/5]
|
explicit |
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 249 of file keditlistbox.cpp.
◆ KEditListBox() [4/5]
|
explicit |
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 257 of file keditlistbox.cpp.
◆ KEditListBox() [5/5]
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 265 of file keditlistbox.cpp.
◆ ~KEditListBox()
|
virtual |
Definition at line 275 of file keditlistbox.cpp.
Member Function Documentation
◆ addButton()
QPushButton * KEditListBox::addButton | ( | ) | const |
Return a pointer to the Add button.
Definition at line 295 of file keditlistbox.cpp.
◆ added
|
signal |
This signal is emitted when the user adds a new string to the list, the parameter is the added string.
◆ addItem
|
protectedslot |
Definition at line 479 of file keditlistbox.cpp.
◆ buttons()
KEditListBox::Buttons KEditListBox::buttons | ( | ) | const |
Returns which buttons are visible.
Definition at line 659 of file keditlistbox.cpp.
◆ changed
|
signal |
◆ checkAtEntering()
bool KEditListBox::checkAtEntering | ( | ) |
Returns true if check at entering is enabled.
Definition at line 375 of file keditlistbox.cpp.
◆ clear()
void KEditListBox::clear | ( | ) |
Clears both the listbox and the line edit.
Definition at line 602 of file keditlistbox.cpp.
◆ count()
int KEditListBox::count | ( | ) | const |
See Q3ListBox::count()
Definition at line 315 of file keditlistbox.cpp.
◆ currentItem()
int KEditListBox::currentItem | ( | ) | const |
See Q3ListBox::currentItem()
Definition at line 533 of file keditlistbox.cpp.
◆ currentText()
QString KEditListBox::currentText | ( | ) | const |
See Q3ListBox::currentText()
Definition at line 640 of file keditlistbox.cpp.
◆ downButton()
QPushButton * KEditListBox::downButton | ( | ) | const |
Return a pointer to the Down button.
Definition at line 310 of file keditlistbox.cpp.
◆ enableMoveButtons
|
protectedslot |
Definition at line 564 of file keditlistbox.cpp.
◆ eventFilter()
bool KEditListBox::eventFilter | ( | QObject * | o, |
QEvent * | e | ||
) |
Reimplented for interal reasons.
The API is not affected.
Definition at line 674 of file keditlistbox.cpp.
◆ insertItem()
void KEditListBox::insertItem | ( | const QString & | text, |
int | index = -1 |
||
) |
See Q3ListBox::insertItem()
Definition at line 621 of file keditlistbox.cpp.
◆ insertStringList()
void KEditListBox::insertStringList | ( | const QStringList & | list, |
int | index = -1 |
||
) |
See Q3ListBox::insertStringList()
Definition at line 609 of file keditlistbox.cpp.
◆ items()
QStringList KEditListBox::items | ( | ) | const |
- Returns
- a stringlist of all items in the listbox
Definition at line 649 of file keditlistbox.cpp.
◆ lineEdit()
KLineEdit * KEditListBox::lineEdit | ( | ) | const |
Return a pointer to the embedded KLineEdit.
Definition at line 290 of file keditlistbox.cpp.
◆ listView()
QListView * KEditListBox::listView | ( | ) | const |
Return a pointer to the embedded QListView.
Definition at line 285 of file keditlistbox.cpp.
◆ moveItemDown
|
protectedslot |
Definition at line 451 of file keditlistbox.cpp.
◆ moveItemUp
|
protectedslot |
Definition at line 423 of file keditlistbox.cpp.
◆ removeButton()
QPushButton * KEditListBox::removeButton | ( | ) | const |
Return a pointer to the Remove button.
Definition at line 300 of file keditlistbox.cpp.
◆ removed
|
signal |
This signal is emitted when the user removes a string from the list, the parameter is the removed string.
◆ removeItem
|
protectedslot |
Definition at line 542 of file keditlistbox.cpp.
◆ setButtons()
void KEditListBox::setButtons | ( | Buttons | buttons | ) |
Specifies which buttons should be visible.
Definition at line 320 of file keditlistbox.cpp.
◆ setCheckAtEntering()
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 370 of file keditlistbox.cpp.
◆ setCustomEditor()
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 280 of file keditlistbox.cpp.
◆ setItems()
void KEditListBox::setItems | ( | const QStringList & | items | ) |
Clears the listbox and sets the contents to items
.
Definition at line 654 of file keditlistbox.cpp.
◆ text()
QString KEditListBox::text | ( | int | index | ) | const |
See Q3ListBox::text()
Definition at line 633 of file keditlistbox.cpp.
◆ typedSomething
|
protectedslot |
Definition at line 380 of file keditlistbox.cpp.
◆ upButton()
QPushButton * KEditListBox::upButton | ( | ) | const |
Return a pointer to the Up button.
Definition at line 305 of file keditlistbox.cpp.
Property Documentation
◆ buttons
|
readwrite |
Definition at line 1 of file keditlistbox.h.
◆ items
|
readwrite |
Definition at line 1 of file keditlistbox.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.