Main Page Modules Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages
KCompletionBox Class Reference
A helper widget for "completion-widgets" (KLineEdit, KComboBox)).
More...
#include <kcompletionbox.h>
Inheritance diagram for KCompletionBox:
List of all members.
Detailed Description
A helper widget for "completion-widgets" (KLineEdit, KComboBox)).
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.
- Author:
-
Carsten Pfeiffer <pfeiffer@kde.org>
Definition at line 41 of file kcompletionbox.h.
Constructor & Destructor Documentation
| KCompletionBox::KCompletionBox |
( |
QWidget * |
parent, |
|
|
const char * |
name = 0 |
|
) |
|
|
|
|
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. |
| KCompletionBox::~KCompletionBox |
( |
|
) |
|
|
Member Function Documentation
| void KCompletionBox::activated |
( |
const QString & |
|
) |
[signal] |
|
|
|
Emitted when an item was selected, contains the text of the selected item. |
| QString KCompletionBox::cancelledText |
( |
|
) |
[slot] |
|
| void KCompletionBox::down |
( |
|
) |
[slot] |
|
|
|
Moves the selection one line down or select the first item if nothing is selected yet. |
| void KCompletionBox::end |
( |
|
) |
[slot] |
|
|
|
Moves the selection down to the last item. |
| virtual bool KCompletionBox::eventFilter |
( |
QObject * |
, |
|
|
QEvent * |
|
|
) |
[protected, virtual] |
|
|
|
Reimplemented from KListBox to get events from the viewport (to hide this widget on mouse-click, Escape-presses, etc. |
| virtual void KCompletionBox::hide |
( |
|
) |
[virtual, slot] |
|
|
|
Re-implemented for internal reasons. API is unaffected. |
| void KCompletionBox::home |
( |
|
) |
[slot] |
|
|
|
Moves the selection up to the first item. |
| void KCompletionBox::insertItems |
( |
const QStringList & |
items, |
|
|
int |
index = -1 |
|
) |
[slot] |
|
|
|
Inserts items into the box. Does not clear the items before. index determines at which position items will be inserted. (defaults to appending them at the end) |
| bool KCompletionBox::isTabHandling |
( |
|
) |
[slot] |
|
|
|
- Returns:
-
true if this widget is handling Tab-key events to traverse the items in the dropdown list, otherwise false.
Default is false.
- See also:
-
setTabHandling
|
| QStringList KCompletionBox::items |
( |
|
) |
[slot] |
|
|
|
Returns a list of all items currently in the box. |
| void KCompletionBox::pageDown |
( |
|
) |
[slot] |
|
|
|
Moves the selection one page down. |
| void KCompletionBox::pageUp |
( |
|
) |
[slot] |
|
|
|
Moves the selection one page up. |
| virtual void KCompletionBox::popup |
( |
|
) |
[virtual, slot] |
|
|
|
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. |
| void KCompletionBox::setCancelledText |
( |
const QString & |
|
) |
[slot] |
|
|
|
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.
- See also:
-
userCancelled( const QString& )
- Parameters:
-
| txt |
the text to be emitted if the user cancels this box |
|
| void KCompletionBox::setItems |
( |
const QStringList & |
items |
) |
[slot] |
|
|
|
Clears the box and inserts items. |
| void KCompletionBox::setTabHandling |
( |
bool |
enable |
) |
[slot] |
|
|
|
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.
- See also:
-
isTabHandling
|
| virtual void KCompletionBox::show |
( |
|
) |
[virtual, slot] |
|
|
|
Re-implemented for internal reasons. API is unaffected. |
| virtual void KCompletionBox::slotActivated |
( |
QListBoxItem * |
|
) |
[protected, virtual, slot] |
|
|
|
Called when an item was activated. Emits activated() with the item. |
| void KCompletionBox::up |
( |
|
) |
[slot] |
|
|
|
Moves the selection one line up or select the first item if nothing is selected yet. |
| void KCompletionBox::userCancelled |
( |
const QString & |
|
) |
[signal] |
|
|
|
Emitted whenever the user chooses to ignore the available selections and close the this box. |
The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:07 2003 for kdelibs by
1.2.18