KCompletion
klineedit.h
97 * connect(edit, &KLineEdit::returnKeyPressed, comp, [this](const QString &text) { addItem(text); });
107 * connect(edit, &KLineEdit::returnKeyPressed, comp, [this](const QString &text) { addItem(text); });
138class KCOMPLETION_EXPORT KLineEdit : public QLineEdit, public KCompletionBase // krazy:exclude=qclasses
virtual void setCompletionMode(KCompletion::CompletionMode mode)
Sets the type of completion to be used.
Definition kcompletionbase.cpp:185
virtual void setCompletedItems(const QStringList &items, bool autoSuggest=true)=0
A pure virtual function that must be implemented by all inheriting classes.
virtual void setCompletedText(const QString &text)=0
A pure virtual function that must be implemented by all inheriting classes.
virtual void setCompletionObject(KCompletion *completionObject, bool handleSignals=true)
Sets up the completion object to be used.
Definition kcompletionbase.cpp:104
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
CompletionMode
This enum describes the completion mode used for by the KCompletion class.
Definition kcompletion.h:131
KLineEdit(const QString &string, QWidget *parent=nullptr)
Constructs a KLineEdit object with a default text, a parent, and a name.
Definition klineedit.cpp:128
void setTrapReturnKey(bool trap)
By default, KLineEdit recognizes Key_Return and Key_Enter and emits the returnPressed() signals,...
Definition klineedit.cpp:1059
void setSqueezedTextEnabled(bool enable)
Enable text squeezing whenever the supplied text is too long.
Definition klineedit.cpp:324
void rotateText(KCompletionBase::KeyBindingType type)
Iterates through all possible matches of the completed text or the history list.
Definition klineedit.cpp:231
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 setCompletionBox(KCompletionBox *box)
Set the completion-box to be used in completion mode CompletionPopup.
Definition klineedit.cpp:1076
void setUserSelection(bool userSelection)
Sets the widget in userSelection mode or in automatic completion selection mode.
Definition klineedit.cpp:1304
bool urlDropsEnabled() const
Returns true when decoded URL drops are enabled.
Definition klineedit.cpp:1053
bool autoSuggest() const
Whether in current state text should be auto-suggested.
Definition klineedit.cpp:1366
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 clearButtonClicked()
Emitted when the user clicked on the clear button.
void setSqueezedText(const QString &text)
Squeezes text into the line edit.
Definition klineedit.cpp:318
void setCompletionModeDisabled(KCompletion::CompletionMode mode, bool disable=true)
Disables completion modes by making them non-checkable.
Definition klineedit.cpp:195
QString originalText() const
Returns the original text if text squeezing is enabled.
Definition klineedit.cpp:1350
virtual KCompletionBox * completionBox(bool create=true)
This method will create a completion-box if none is there, yet.
Definition klineedit.cpp:1274
void substringCompletion(const QString &)
Emitted when the shortcut for substring completion is pressed.
void userCancelled(const QString &cancelText)
Resets the current displayed text.
Definition klineedit.cpp:1111
bool isSqueezedTextEnabled() const
Returns true if text squeezing is enabled.
Definition klineedit.cpp:330
virtual void makeCompletion(const QString &)
Completes the remaining text with a matching one from a given list.
Definition klineedit.cpp:253
QLineEdit(QWidget *parent)
virtual void contextMenuEvent(QContextMenuEvent *event) override
void copy() const const
QMenu * createStandardContextMenu()
virtual bool event(QEvent *e) override
virtual void keyPressEvent(QKeyEvent *event) override
virtual void mouseDoubleClickEvent(QMouseEvent *e) override
virtual void mousePressEvent(QMouseEvent *e) override
virtual void mouseReleaseEvent(QMouseEvent *e) override
virtual void paintEvent(QPaintEvent *) override
void setReadOnly(bool)
text
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
void create(WId window, bool initializeWindow, bool destroyOldWindow)
virtual void resizeEvent(QResizeEvent *event)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:58:10 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:58:10 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.