#include <kcompletionbox.h>
Inheritance diagram for KCompletionBox:
Public Slots | |
QStringList | items () const |
void | insertItems (const QStringList &items, int index=-1) |
void | setItems (const QStringList &items) |
virtual void | popup () |
void | setTabHandling (bool enable) |
bool | isTabHandling () const |
void | setCancelledText (const QString &) |
QString | cancelledText () const |
void | down () |
void | up () |
void | pageDown () |
void | pageUp () |
void | home () |
void | end () |
virtual void | show () |
virtual void | hide () |
Signals | |
void | activated (const QString &) |
void | userCancelled (const QString &) |
Public Methods | |
KCompletionBox (QWidget *parent, const char *name=0) | |
~KCompletionBox () | |
virtual QSize | sizeHint () const |
Protected Slots | |
virtual void | slotActivated (QListBoxItem *) |
Protected Methods | |
virtual bool | eventFilter (QObject *, QEvent *) |
virtual void | virtual_hook (int id, void *data) |
A little utility class for "completion-widgets", like KLineEdit or KComboBox. KCompletionBox is a listbox, displayed as a rectangle without any window decoration, usually directly under the lineedit or combobox. It is filled with all possible matches for a completion, so the user can select the one he wants.
It is used when KGlobalSettings::Completion == CompletionPopup or CompletionPopupAuto.
|
Constructs a KCompletionBox. Notice: the parent needs to be always 0L, so you can't specify it in the constructor. Because of that, Qt's auto-deletion does not take place, so you have to explicitly delete this widget when you don't need it anymore. The parent widget is used to give the focus back when pressing the up-button on the very first item. |
|
Destroys the box |
|
Emitted when an item was selected, contains the text of the selected item. |
|
|
|
Moves the selection one line down or select the first item if nothing is selected yet. |
|
Moves the selection down to the last item. |
|
Reimplemented from KListBox to get events from the viewport (to hide this widget on mouse-click, Escape-presses, etc. |
|
Re-implemented for internal reasons. API is unaffected. |
|
Moves the selection up to the first item. |
|
Inserts |
|
|
|
Returns a list of all items currently in the box. |
|
Moves the selection one page down. |
|
Moves the selection one page up. |
|
Adjusts the size of the box to fit the width of the parent given in the constructor and pops it up at the most appropriate place, relative to the parent. Depending on the screensize and the position of the parent, this may be a different place, however the default is to pop it up and the lower left corner of the parent. Make sure to hide() the box when appropriate. |
|
Sets the text to be emitted if the user chooses not to pick from the available matches. If the cancelled text is not set through this function, the userCancelled signal will not be emitted.
|
|
Clears the box and inserts |
|
Makes this widget (when visible) capture Tab-key events to traverse the items in the dropdown list. Default off, as it conflicts with the usual behavior of Tab to traverse widgets. It is useful for cases like Konqueror's Location Bar, though.
|
|
Re-implemented for internal reasons. API is unaffected. |
|
Called when an item was activated. Emits activated() with the item. |
|
Moves the selection one line up or select the first item if nothing is selected yet. |
|
Emitted whenever the user chooses to ignore the available selections and close the this box. |