KCompletion

klineedit.h
1 /*
2  This file is part of the KDE libraries
3 
4  This class was originally inspired by Torben Weis'
5  fileentry.cpp for KFM II.
6 
7  SPDX-FileCopyrightText: 1997 Sven Radej <[email protected]>
8  SPDX-FileCopyrightText: 1999 Patrick Ward <[email protected]>
9  SPDX-FileCopyrightText: 1999 Preston Brown <[email protected]>
10 
11  Completely re-designed:
12  SPDX-FileCopyrightText: 2000, 2001 Dawit Alemayehu <[email protected]>
13 
14  SPDX-License-Identifier: LGPL-2.0-or-later
15 */
16 
17 #ifndef KLINEEDIT_H
18 #define KLINEEDIT_H
19 
20 #include <kcompletion.h>
21 #include <kcompletion_export.h>
22 #include <kcompletionbase.h>
23 
24 #include <QLineEdit>
25 #include <memory>
26 
27 class QAction;
28 class QMenu;
29 class KCompletionBox;
30 class QUrl;
31 class KLineEditPrivate;
32 
33 /**
34  * @class KLineEdit klineedit.h KLineEdit
35  *
36  * An enhanced QLineEdit widget for inputting text.
37  *
38  * \b Detail \n
39  *
40  * This widget inherits from QLineEdit and implements the following
41  * additional functionalities:
42  * @li a completion object that provides both automatic and manual text
43  * completion as well as multiple match iteration features
44  * @li configurable key-bindings to activate these features
45  * @li a popup-menu item that can be used to allow the user to set text
46  * completion modes on the fly based on their preference
47  *
48  * To support these features KLineEdit also emits a few more additional
49  * signals:
50  * @li @c completion(const QString &): this signal can be connected to
51  * a slot that will assist the user in filling out the remaining text
52  * @li @c textRotation(KeyBindingType): this signal is intended to be
53  * used to iterate through the list of all possible matches whenever
54  * there is more than one match for the entered text
55  * @li @c returnKeyPressed(const QString &): this signal provides the
56  * current text in the widget as its argument whenever appropriate (this
57  * is in addition to the @c QLineEdit::returnPressed() signal which KLineEdit
58  * inherits from QLineEdit).
59  *
60  * This widget by default creates a completion object when you invoke
61  * the @c completionObject(bool) member function for the first time or
62  * use @c setCompletionObject(KCompletion *, bool) to assign your own
63  * completion object. Additionally, to make this widget more functional,
64  * KLineEdit will by default handle the text rotation and completion
65  * events internally when a completion object is created through either one
66  * of the methods mentioned above. If you do not need this functionality,
67  * simply use @c KCompletionBase::setHandleSignals(bool) or set the boolean
68  * parameter in the above functions to false.
69  *
70  * The default key-bindings for completion and rotation is determined
71  * from the global settings in KStandardShortcut. These values, however,
72  * can be overridden locally by invoking @c KCompletionBase::setKeyBinding().
73  * The values can easily be reverted back to the default setting, by simply
74  * calling @c useGlobalSettings(). An alternate method would be to default
75  * individual key-bindings by using setKeyBinding() with the default
76  * second argument.
77  *
78  * If @c EchoMode for this widget is set to something other than @c QLineEdit::Normal,
79  * the completion mode will always be defaulted to CompletionNone.
80  * This is done purposefully to guard against protected entries, such as
81  * passwords, being cached in KCompletion's list. Hence, if the @c EchoMode
82  * is not @c QLineEdit::Normal, the completion mode is automatically disabled.
83  *
84  * A read-only KLineEdit will have the same background color as a disabled
85  * KLineEdit, but its foreground color will be the one used for the read-write
86  * mode. This differs from QLineEdit's implementation and is done to give visual
87  * distinction between the three different modes: disabled, read-only, and read-write.
88  *
89  * @b Usage
90  *
91  * To enable the basic completion feature:
92  *
93  * @code
94  * KLineEdit *edit = new KLineEdit(this);
95  * KCompletion *comp = edit->completionObject();
96  * // Connect to the Return pressed signal - optional
97  * connect(edit, &KLineEdit::returnKeyPressed, comp, [this](const QString &text) { addItem(text); });
98  * @endcode
99  *
100  * To use a customized completion object or your own completion object:
101  *
102  * @code
103  * KLineEdit *edit = new KLineEdit(this);
104  * KUrlCompletion *comp = new KUrlCompletion();
105  * edit->setCompletionObject(comp);
106  * // Connect to the return pressed signal - optional
107  * connect(edit, &KLineEdit::returnKeyPressed, comp, [this](const QString &text) { addItem(text); });
108  * @endcode
109  *
110  * Note if you specify your own completion object you have to either delete
111  * it when you don't need it anymore, or you can tell KLineEdit to delete it
112  * for you:
113  * @code
114  * edit->setAutoDeleteCompletionObject(true);
115  * @endcode
116  *
117  * <b>Miscellaneous function calls :</b>\n
118  *
119  * @code
120  * // Tell the widget to not handle completion and iteration automatically
121  * edit->setHandleSignals(false);
122  *
123  * // Set your own key-bindings for a text completion mode
124  * edit->setKeyBinding(KCompletionBase::TextCompletion, Qt::End);
125  *
126  * // Hide the context (popup) menu
127  * edit->setContextMenuPolicy(Qt::NoContextMenu);
128  *
129  * // Default the key-bindings back to the default system settings
130  * edit->useGlobalKeyBindings();
131  * @endcode
132  *
133  * @image html klineedit.png "KLineEdit widgets with clear-button"
134  *
135  * @author Dawit Alemayehu <[email protected]>
136  */
137 
138 class KCOMPLETION_EXPORT KLineEdit : public QLineEdit, public KCompletionBase // krazy:exclude=qclasses
139 {
140  friend class KComboBox;
141  friend class KLineEditStyle;
142 
143  Q_OBJECT
144  Q_DECLARE_PRIVATE(KLineEdit)
145 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(4, 5)
146  Q_PROPERTY(bool contextMenuEnabled READ isContextMenuEnabled WRITE setContextMenuEnabled)
147 #endif
148 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(5, 0)
149  Q_PROPERTY(bool urlDropsEnabled READ urlDropsEnabled WRITE setUrlDropsEnabled)
150 #endif
151  Q_PROPERTY(bool trapEnterKeyEvent READ trapReturnKey WRITE setTrapReturnKey)
152  Q_PROPERTY(bool squeezedTextEnabled READ isSqueezedTextEnabled WRITE setSqueezedTextEnabled)
153 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(5, 0)
154  Q_PROPERTY(QString clickMessage READ clickMessage WRITE setClickMessage)
155 #endif
156 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(5, 46)
157  Q_PROPERTY(bool showClearButton READ isClearButtonShown WRITE setClearButtonShown)
158 #endif
159 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(5, 83)
160  Q_PROPERTY(bool passwordMode READ passwordMode WRITE setPasswordMode)
161 #endif
162 
163 public:
164  /**
165  * Constructs a KLineEdit object with a default text, a parent,
166  * and a name.
167  *
168  * @param string Text to be shown in the edit widget.
169  * @param parent The parent widget of the line edit.
170  */
171  explicit KLineEdit(const QString &string, QWidget *parent = nullptr);
172 
173  /**
174  * Constructs a line edit
175  * @param parent The parent widget of the line edit.
176  */
177  explicit KLineEdit(QWidget *parent = nullptr);
178 
179  /**
180  * Destructor.
181  */
182  ~KLineEdit() override;
183 
184  /**
185  * Sets @p url into the lineedit. It uses QUrl::toDisplayString() so
186  * that the url is properly decoded for displaying.
187  */
188  void setUrl(const QUrl &url);
189 
190  /**
191  * Reimplemented from KCompletionBase for internal reasons.
192  *
193  * This function is re-implemented in order to make sure that
194  * the EchoMode is acceptable before we set the completion mode.
195  *
196  * See KCompletionBase::setCompletionMode
197  */
199 
200  /**
201  * Disables completion modes by making them non-checkable.
202  *
203  * The context menu allows to change the completion mode.
204  * This method allows to disable some modes.
205  */
206  void setCompletionModeDisabled(KCompletion::CompletionMode mode, bool disable = true);
207 
208 #if KCOMPLETION_BUILD_DEPRECATED_SINCE(4, 5)
209  /**
210  * Enables/disables the popup (context) menu.
211  *
212  * This method only works if this widget is editable, i.e. read-write and
213  * allows you to enable/disable the context menu. It does nothing if invoked
214  * for a none-editable combo-box.
215  *
216  * By default, the context menu is created if this widget is editable.
217  * Call this function with the argument set to false to disable the popup
218  * menu.
219  *
220  * @param showMenu If @c true, show the context menu.
221  * @deprecated since 4.5, use setContextMenuPolicy instead
222  */
223  KCOMPLETION_DEPRECATED_VERSION(4, 5, "Use QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy)")
224  virtual void setContextMenuEnabled(bool showMenu);
225 #endif
226 
227 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(4, 5)
228  /**
229  * Returns @c true when the context menu is enabled.
230  * @deprecated since 4.5, use contextMenuPolicy instead
231  */
232  KCOMPLETION_DEPRECATED_VERSION(4, 5, "Use QWidget::contextMenuPolicy()")
233  bool isContextMenuEnabled() const;
234 #endif
235 
236  /**
237  * Enables/Disables handling of URL drops. If enabled and the user
238  * drops an URL, the decoded URL will be inserted. Otherwise the default
239  * behavior of QLineEdit is used, which inserts the encoded URL.
240  * Call setUrlDropsEnabled(false) if you need dropEvent to be called in a KLineEdit subclass.
241  *
242  * @param enable If @c true, insert decoded URLs
243  */
244  void setUrlDropsEnabled(bool enable); // KF6: remove it and don't create LineEditUrlDropEventFilter by default.
245 
246  /**
247  * Returns @c true when decoded URL drops are enabled
248  */
249  bool urlDropsEnabled() const;
250 
251  /**
252  * By default, KLineEdit recognizes @c Key_Return and @c Key_Enter and emits
253  * the returnPressed() signals, but it also lets the event pass,
254  * for example causing a dialog's default-button to be called.
255  *
256  * Call this method with @p trap = @c true to make @c KLineEdit stop these
257  * events. The signals will still be emitted of course.
258  *
259  * @see trapReturnKey()
260  */
261  void setTrapReturnKey(bool trap);
262 
263  /**
264  * @returns @c true if keyevents of @c Key_Return or
265  * @c Key_Enter will be stopped or if they will be propagated.
266  *
267  * @see setTrapReturnKey ()
268  */
269  bool trapReturnKey() const;
270 
271  /**
272  * This method will create a completion-box if none is there, yet.
273  *
274  * @param create Set this to false if you don't want the box to be created
275  * i.e. to test if it is available.
276  * @returns the completion-box, that is used in completion mode
277  * CompletionPopup.
278  */
279  virtual KCompletionBox *completionBox(bool create = true);
280 
281  /**
282  * Reimplemented for internal reasons, the API is not affected.
283  */
284  void setCompletionObject(KCompletion *, bool handle = true) override;
285 
286  /**
287  * Reimplemented for internal reasons, the API is not affected.
288  */
289  virtual void copy() const;
290 
291  /**
292  * Enable text squeezing whenever the supplied text is too long.
293  * Only works for "read-only" mode.
294  *
295  * Note that once text squeezing is enabled, QLineEdit::text()
296  * and QLineEdit::displayText() return the squeezed text. If
297  * you want the original text, use @ref originalText.
298  *
299  * @see QLineEdit
300  */
301  void setSqueezedTextEnabled(bool enable);
302 
303  /**
304  * Returns true if text squeezing is enabled.
305  * This is only valid when the widget is in read-only mode.
306  */
307  bool isSqueezedTextEnabled() const;
308 
309  /**
310  * Returns the original text if text squeezing is enabled.
311  * If the widget is not in "read-only" mode, this function
312  * returns the same thing as QLineEdit::text().
313  *
314  * @see QLineEdit
315  */
316  QString originalText() const;
317 
318  /**
319  * Returns the text as given by the user (i.e. not autocompleted)
320  * if the widget has autocompletion disabled, this function
321  * returns the same as QLineEdit::text().
322  * @since 4.2.2
323  */
324  QString userText() const;
325 
326  /**
327  * Set the completion-box to be used in completion mode
328  * CompletionPopup.
329  * This will do nothing if a completion-box already exists.
330  *
331  * @param box The KCompletionBox to set
332  */
333  void setCompletionBox(KCompletionBox *box);
334 
335 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 0)
336  /**
337  * This makes the line edit display a grayed-out hinting text as long as
338  * the user didn't enter any text. It is often used as indication about
339  * the purpose of the line edit.
340  * @deprecated since 5.0, use QLineEdit::setPlaceholderText instead.
341  */
342  KCOMPLETION_DEPRECATED_VERSION(5, 0, "Use QLineEdit::setPlaceholderText(const QString&)")
343  void setClickMessage(const QString &msg);
344 #endif
345 
346 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 0)
347  /**
348  * @return the message set with setClickMessage
349  * @deprecated since 5.0, use QLineEdit::placeholderText instead.
350  */
351  KCOMPLETION_DEPRECATED_VERSION(5, 0, "Use QLineEdit::placeholderText()")
352  QString clickMessage() const;
353 #endif
354 
355 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 46)
356  /**
357  * This makes the line edit display an icon on one side of the line edit
358  * which, when clicked, clears the contents of the line edit.
359  * This is useful for such things as location or search bars.
360  *
361  * @deprecated since 5.46 Use QLineEdit::setClearButtonEnabled
362  */
363  KCOMPLETION_DEPRECATED_VERSION(5, 46, "Use QLineEdit::setClearButtonEnabled(bool)")
364  void setClearButtonShown(bool show);
365 #endif
366 
367 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 46)
368  /**
369  * @return whether or not the clear button is shown
370  *
371  * @deprecated since 5.46 Use QLineEdit::isClearButtonEnabled
372  */
373  KCOMPLETION_DEPRECATED_VERSION(5, 46, "Use QLineEdit::isClearButtonEnabled()")
374  bool isClearButtonShown() const;
375 #endif
376 
377  /**
378  * @return the size used by the clear button
379  * @since 4.1
380  */
381  QSize clearButtonUsedSize() const;
382 
383  /**
384  * Do completion now. This is called automatically when typing a key for instance.
385  * Emits completion() and/or calls makeCompletion(), depending on
386  * emitSignals and handleSignals.
387  *
388  * @since 4.2.1
389  */
390  void doCompletion(const QString &text);
391 
392 Q_SIGNALS:
393  /**
394  * Emitted whenever the completion box is activated.
395  */
396  void completionBoxActivated(const QString &);
397 
398 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 81)
399  /**
400  * Emitted when the user presses the Return or Enter key.
401  *
402  * The argument is the current text. Note that this
403  * signal is @em not emitted if the widget's @c EchoMode is set to
404  * QLineEdit::EchoMode.
405  *
406  * @deprecated since 5.81, use the KLineEdit::returnKeyPressed(const QString &) signal instead
407  */
408  KCOMPLETION_DEPRECATED_VERSION(5, 81, "Use the KLineEdit::returnKeyPressed(const QString &) signal instead")
409  void returnPressed(const QString &text); // clazy:exclude=overloaded-signal
410 #endif
411 
412  /**
413  * Emitted when the user presses the Return or Enter key.
414  *
415  * The argument is the current text. Note that this signal is @em not emitted
416  * if the widget's @c EchoMode is set to QLineEdit::EchoMode.
417  *
418  * @since 5.81
419  */
420  void returnKeyPressed(const QString &text);
421 
422  /**
423  * Emitted when the completion key is pressed.
424  *
425  * Please note that this signal is @em not emitted if the
426  * completion mode is set to @c CompletionNone or @c EchoMode is
427  * @em normal.
428  */
429  void completion(const QString &);
430 
431  /**
432  * Emitted when the shortcut for substring completion is pressed.
433  */
434  void substringCompletion(const QString &);
435 
436 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(4, 5)
437  /**
438  * Emitted when the text is changed NOT by the suggested autocompletion:
439  * either when the user is physically typing keys, or when the text is changed programmatically,
440  * for example, by calling setText().
441  * But not when automatic completion changes the text temporarily.
442  *
443  * @since 4.2.2
444  * @deprecated since 4.5. You probably want to connect to textEdited() instead,
445  * which is emitted whenever the text is actually changed by the user
446  * (by typing or accepting autocompletion), without side effects from
447  * suggested autocompletion either. userTextChanged isn't needed anymore.
448  */
449  KCOMPLETION_DEPRECATED_VERSION(4, 5, "Use QLineEdit::textEdited(const QString&)")
450  QT_MOC_COMPAT void userTextChanged(const QString &);
451 #endif
452 
453  /**
454  * Emitted when the text rotation key-bindings are pressed.
455  *
456  * The argument indicates which key-binding was pressed.
457  * In KLineEdit's case this can be either one of two values:
458  * PrevCompletionMatch or NextCompletionMatch. See
459  * KCompletionBase::setKeyBinding for details.
460  *
461  * Note that this signal is @em not emitted if the completion
462  * mode is set to @c CompletionNone or @c echoMode() is @em not normal.
463  */
464  void textRotation(KCompletionBase::KeyBindingType);
465 
466  /**
467  * Emitted when the user changed the completion mode by using the
468  * popupmenu.
469  */
470  void completionModeChanged(KCompletion::CompletionMode);
471 
472  /**
473  * Emitted before the context menu is displayed.
474  *
475  * The signal allows you to add your own entries into the
476  * the context menu that is created on demand.
477  *
478  * NOTE: Do not store the pointer to the QMenu
479  * provided through since it is created and deleted
480  * on demand.
481  *
482  * @param contextMenu the context menu about to be displayed
483  */
484  void aboutToShowContextMenu(QMenu *contextMenu);
485 
486  /**
487  * Emitted when the user clicked on the clear button
488  */
489  void clearButtonClicked();
490 
491 public Q_SLOTS:
492 
493  /**
494  * Sets the lineedit to read-only. Similar to QLineEdit::setReadOnly
495  * but also takes care of the background color, and the clear button.
496  */
497  virtual void setReadOnly(bool);
498 
499  /**
500  * Iterates through all possible matches of the completed text or
501  * the history list.
502  *
503  * This function simply iterates over all possible matches in case
504  * multiple matches are found as a result of a text completion request.
505  * It will have no effect if only a single match is found.
506  *
507  * @param type The key-binding invoked.
508  */
509  void rotateText(KCompletionBase::KeyBindingType type);
510 
511  /**
512  * See KCompletionBase::setCompletedText.
513  */
514  void setCompletedText(const QString &) override;
515 
516  /**
517  * Same as the above function except it allows you to temporarily
518  * turn off text completion in CompletionPopupAuto mode.
519  *
520  *
521  * @param items list of completion matches to be shown in the completion box.
522  * @param autoSuggest true if you want automatic text completion (suggestion) enabled.
523  */
524  void setCompletedItems(const QStringList &items, bool autoSuggest = true) override;
525 
526  /**
527  * Squeezes @p text into the line edit.
528  * This can only be used with read-only line-edits.
529  */
530  void setSqueezedText(const QString &text);
531 
532  /**
533  * Reimplemented to enable text squeezing. API is not affected.
534  */
535  virtual void setText(const QString &);
536 
537 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 83)
538  /**
539  * @brief set the line edit in password mode.
540  * this change the EchoMode according to KDE preferences.
541  * @param passwordMode true to set in password mode
542  *
543  * @deprecated Since 5.83, use KPasswordLineEdit or QLineEdit::setEchoMode(QLineEdit::EchoMode).
544  */
545  KCOMPLETION_DEPRECATED_VERSION(5, 83, "Use KPasswordLineEdit or QLineEdit::setEchoMode(QLineEdit::EchoMode)")
546  void setPasswordMode(bool passwordMode = true);
547 #endif
548 
549 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 83)
550  /**
551  * @return returns true if the lineedit is set to password mode echoing
552  *
553  * @deprecated Since 5.83, see setPasswordMode(bool)
554  */
555  KCOMPLETION_DEPRECATED_VERSION(5, 83, "See API docs")
556  bool passwordMode() const;
557 #endif
558 
559 protected Q_SLOTS:
560 
561  /**
562  * Completes the remaining text with a matching one from
563  * a given list.
564  */
565  virtual void makeCompletion(const QString &);
566 
567  /**
568  * Resets the current displayed text.
569  * Call this function to revert a text completion if the user
570  * cancels the request. Mostly applies to popup completions.
571  */
572  void userCancelled(const QString &cancelText);
573 
574 protected:
575  /**
576  * Reimplemented for internal reasons. API not affected.
577  */
578  bool event(QEvent *) override;
579 
580  /**
581  * Reimplemented for internal reasons. API not affected.
582  *
583  * See QLineEdit::resizeEvent().
584  */
585  void resizeEvent(QResizeEvent *) override;
586 
587  /**
588  * Reimplemented for internal reasons. API not affected.
589  *
590  * See QLineEdit::keyPressEvent().
591  */
592  void keyPressEvent(QKeyEvent *) override;
593 
594  /**
595  * Reimplemented for internal reasons. API not affected.
596  *
597  * See QLineEdit::mousePressEvent().
598  */
599  void mousePressEvent(QMouseEvent *) override;
600 
601  /**
602  * Reimplemented for internal reasons. API not affected.
603  *
604  * See QLineEdit::mouseReleaseEvent().
605  */
606  void mouseReleaseEvent(QMouseEvent *) override;
607 
608  /**
609  * Reimplemented for internal reasons. API not affected.
610  *
611  * See QWidget::mouseDoubleClickEvent().
612  */
613  void mouseDoubleClickEvent(QMouseEvent *) override;
614 
615  /**
616  * Reimplemented for internal reasons. API not affected.
617  *
618  * See QLineEdit::contextMenuEvent().
619  */
620  void contextMenuEvent(QContextMenuEvent *) override;
621 
622  /**
623  * Reimplemented for internal reasons. API not affected.
624  *
625  * See QLineEdit::createStandardContextMenu().
626  */
628 
629  /**
630  * This function simply sets the lineedit text and
631  * highlights the text appropriately if the boolean
632  * value is set to true.
633  *
634  * @param text
635  * @param marked
636  */
637  virtual void setCompletedText(const QString & /*text*/, bool /*marked*/);
638 
639  /**
640  * Sets the widget in userSelection mode or in automatic completion
641  * selection mode. This changes the colors of selections.
642  */
643  void setUserSelection(bool userSelection);
644 
645  /**
646  * Whether in current state text should be auto-suggested
647  */
648  bool autoSuggest() const;
649 
650  void paintEvent(QPaintEvent *ev) override;
651 
652 private:
653  std::unique_ptr<KLineEditPrivate> const d_ptr;
654 };
655 
656 #endif
virtual void contextMenuEvent(QContextMenuEvent *event) override
void setText(const QString &)
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
virtual bool event(QEvent *e) override
QMenu * createStandardContextMenu()
virtual void setCompletedText(const QString &text)=0
A pure virtual function that must be implemented by all inheriting classes.
virtual void keyPressEvent(QKeyEvent *event) override
void setReadOnly(bool)
PartitionTable::TableType type
CompletionMode
This enum describes the completion mode used for by the KCompletion class.
Definition: kcompletion.h:131
A generic class for completing QStrings.
Definition: kcompletion.h:117
virtual void paintEvent(QPaintEvent *) override
virtual void mouseReleaseEvent(QMouseEvent *e) override
Q_PROPERTY(...)
An abstract base class for adding a completion feature into widgets.
virtual void setCompletionMode(KCompletion::CompletionMode mode)
Sets the type of completion to be used.
void returnPressed()
An enhanced QLineEdit widget for inputting text.
Definition: klineedit.h:138
A combo box with completion support.
Definition: kcombobox.h:135
KeyBindingType
Constants that represent the items whose shortcut key binding is programmable.
virtual void setCompletionObject(KCompletion *completionObject, bool handleSignals=true)
Sets up the completion object to be used.
virtual void resizeEvent(QResizeEvent *event)
void copy() const const
virtual void setCompletedItems(const QStringList &items, bool autoSuggest=true)=0
A pure virtual function that must be implemented by all inheriting classes.
virtual void mouseDoubleClickEvent(QMouseEvent *e) override
virtual void mousePressEvent(QMouseEvent *e) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Nov 28 2021 22:47:26 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.