KCompletion
kcombobox.cpp
30 const KCompletionBase *base = static_cast<const KCompletionBase *>(static_cast<const KLineEdit *>(sender));
261 edit->setCompleter(nullptr); // remove Qt's builtin completer (set by setLineEdit), we have our own
278 connect(d->klineEdit, &KLineEdit::returnKeyPressed, this, qOverload<const QString &>(&KComboBox::returnPressed));
286 connect(d->klineEdit, &KLineEdit::completionModeChanged, this, &KComboBox::completionModeChanged);
void substringCompletion(const QString &)
Emitted when the shortcut for substring completion is pressed.
QMenu * contextMenu() const
Pointer to KLineEdit's context menu, or nullptr if it does not exist at the given moment.
Definition kcombobox.cpp:300
bool contains(const QString &text) const
Convenience method which iterates over all items and checks if any of them is equal to text.
Definition kcombobox.cpp:64
void completionModeChanged(KCompletion::CompletionMode)
Emitted whenever the completion mode is changed by the user through the context menu.
virtual void makeCompletion(const QString &)
Completes text according to the completion mode.
Definition kcombobox.cpp:125
void setEditUrl(const QUrl &url)
Sets url into the edit field of the combo box.
Definition kcombobox.cpp:167
void setCurrentItem(const QString &item, bool insert=false, int index=-1)
Selects the first item that matches item.
Definition kcombobox.cpp:305
bool urlDropsEnabled() const
Returns true when decoded URL drops are enabled.
Definition kcombobox.cpp:103
void changeUrl(int index, const QUrl &url)
Replaces the item at position index with url.
Definition kcombobox.cpp:192
void textRotation(KCompletionBase::KeyBindingType)
Emitted when the text rotation key bindings are pressed.
void returnPressed(const QString &text)
Emitted when the user presses the Return or Enter key.
void setCompletedItems(const QStringList &items, bool autoSuggest=true) override
Sets items into the completion box if completionMode() is CompletionPopup.
Definition kcombobox.cpp:203
void setTrapReturnKey(bool trap)
By default, KComboBox recognizes Key_Return and Key_Enter and emits the returnPressed(const QString &...
Definition kcombobox.cpp:149
void insertUrl(int index, const QUrl &url)
Inserts url at position index into the combo box.
Definition kcombobox.cpp:182
void setEditable(bool editable)
Reimplemented so that setEditable(true) creates a KLineEdit instead of QLineEdit.
Definition kcombobox.cpp:329
void setCompletedText(const QString &) override
Sets the completed text in the line edit appropriately.
Definition kcombobox.cpp:117
KCompletionBox * completionBox(bool create=true)
This method will create a completion box by calling KLineEdit::completionBox, if none is there yet.
Definition kcombobox.cpp:211
virtual void setAutoCompletion(bool autocomplete)
Reimplemented from QComboBox.
Definition kcombobox.cpp:84
void rotateText(KCompletionBase::KeyBindingType type)
Iterates through all possible matches of the completed text or the history list.
Definition kcombobox.cpp:141
KComboBox(QWidget *parent=nullptr)
Constructs a read-only (or rather select-only) combo box.
Definition kcombobox.cpp:38
virtual void setLineEdit(QLineEdit *)
Reimplemented for internal reasons.
Definition kcombobox.cpp:237
virtual void setCompletionMode(KCompletion::CompletionMode mode)
Sets the type of completion to be used.
Definition kcompletionbase.cpp:185
void setDelegate(KCompletionBase *delegate)
Sets or removes the delegation object.
Definition kcompletionbase.cpp:70
KCompletion * compObj() const
Returns a pointer to the completion object.
Definition kcompletionbase.cpp:246
KCompletion::CompletionMode completionMode() const
Returns the current completion mode.
Definition kcompletionbase.cpp:201
KeyBindingType
Constants that represent the items whose shortcut key binding is programmable.
Definition kcompletionbase.h:45
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
Definition kcompletionbox.h:37
@ CompletionPopup
Lists all possible matches in a popup list box to choose from.
Definition kcompletion.h:151
void returnKeyPressed(const QString &text)
Emitted when the user presses the Return or Enter key.
void aboutToShowContextMenu(QMenu *contextMenu)
Emitted before the context menu is displayed.
void textRotation(KCompletionBase::KeyBindingType)
Emitted when the text rotation key-bindings are pressed.
void completionBoxActivated(const QString &)
Emitted whenever the completion box is activated.
void completionModeChanged(KCompletion::CompletionMode)
Emitted when the user changed the completion mode by using the popupmenu.
void substringCompletion(const QString &)
Emitted when the shortcut for substring completion is pressed.
virtual void keyboardSearch(const QString &search)
void addItem(const QIcon &icon, const QString &text, const QVariant &userData)
count
void setCurrentIndex(int index)
bool isEditable() const const
void insertItem(int index, const QIcon &icon, const QString &text, const QVariant &userData)
QString itemText(int index) const const
QLineEdit * lineEdit() const const
virtual QSize minimumSizeHint() const const override
void setEditText(const QString &text)
void setItemIcon(int index, const QIcon &icon)
void setItemText(int index, const QString &text)
void setLineEdit(QLineEdit *edit)
void textActivated(const QString &text)
QAbstractItemView * view() const const
void setClearButtonEnabled(bool enable)
cursorPosition
void setCompleter(QCompleter *c)
const char * className() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
virtual const QMetaObject * metaObject() const const
QObject * parent() const const
T qobject_cast(QObject *object)
int height() const const
bool isValid() const const
int width() const const
bool isEmpty() const const
bool isNull() const const
QString toDisplayString(FormattingOptions options) const const
QWidget(QWidget *parent, Qt::WindowFlags f)
void create(WId window, bool initializeWindow, bool destroyOldWindow)
size
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:04:07 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:04:07 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.