Changeset View
Changeset View
Standalone View
Standalone View
src/khistorycombobox.h
Show All 19 Lines | |||||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef KHistoryComboBoxBOX_H | 22 | #ifndef KHistoryComboBoxBOX_H | ||
23 | #define KHistoryComboBoxBOX_H | 23 | #define KHistoryComboBoxBOX_H | ||
24 | 24 | | |||
25 | #include <kcombobox.h> | 25 | #include <kcombobox.h> | ||
26 | #include <kcompletion_export.h> | 26 | #include <kcompletion_export.h> | ||
27 | 27 | | |||
28 | #include <functional> | ||||
29 | | ||||
28 | class KPixmapProvider; | 30 | class KPixmapProvider; | ||
29 | class KHistoryComboBoxPrivate; | 31 | class KHistoryComboBoxPrivate; | ||
30 | 32 | | |||
31 | /** | 33 | /** | ||
32 | * @class KHistoryComboBox khistorycombobox.h KHistoryComboBox | 34 | * @class KHistoryComboBox khistorycombobox.h KHistoryComboBox | ||
33 | * | 35 | * | ||
34 | * @short A combobox for offering a history and completion | 36 | * @short A combobox for offering a history and completion | ||
35 | * | 37 | * | ||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | 62 | public: | |||
167 | * method KPixmapProvider::pixmapFor(). This method is called whenever | 169 | * method KPixmapProvider::pixmapFor(). This method is called whenever | ||
168 | * an item is added to the KHistoryComboBoxBox. Implement it to return your | 170 | * an item is added to the KHistoryComboBoxBox. Implement it to return your | ||
169 | * own custom pixmaps, or use the KUrlPixmapProvider from KIO, | 171 | * own custom pixmaps, or use the KUrlPixmapProvider from KIO, | ||
170 | * which uses KMimeType::pixmapForUrl to resolve icons. | 172 | * which uses KMimeType::pixmapForUrl to resolve icons. | ||
171 | * | 173 | * | ||
172 | * Set @p provider to nullptr if you want to disable pixmaps. Default no pixmaps. | 174 | * Set @p provider to nullptr if you want to disable pixmaps. Default no pixmaps. | ||
173 | * | 175 | * | ||
174 | * @see pixmapProvider | 176 | * @see pixmapProvider | ||
177 | * @deprecated since 5.65, use setIconProvider | ||||
175 | */ | 178 | */ | ||
179 | #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 65) | ||||
180 | KCOMPLETION_DEPRECATED_VERSION(5, 65, "Use setIconProvider") | ||||
176 | void setPixmapProvider(KPixmapProvider *provider); | 181 | void setPixmapProvider(KPixmapProvider *provider); | ||
177 | 182 | | |||
178 | /** | 183 | /** | ||
179 | * @returns the current pixmap provider. | 184 | * @returns the current pixmap provider. | ||
180 | * @see setPixmapProvider | 185 | * @see setPixmapProvider | ||
181 | * @see KPixmapProvider | 186 | * @see KPixmapProvider | ||
187 | * @deprecated since 5.65, unused | ||||
182 | */ | 188 | */ | ||
189 | KCOMPLETION_DEPRECATED_VERSION(5, 65, "unused") | ||||
183 | KPixmapProvider *pixmapProvider() const; | 190 | KPixmapProvider *pixmapProvider() const; | ||
191 | #endif | ||||
192 | | ||||
193 | /** | ||||
194 | * Sets an icon provider, so that items in the combobox can have an icon. | ||||
195 | * The provider is a function that takes a QString and returns a QIcon | ||||
dfaure: Missing `@since 5.66` | |||||
196 | */ | ||||
197 | void setIconProvider(std::function<QIcon(const QString &)> providerFunction); | ||||
184 | 198 | | |||
185 | using QComboBox::insertItems; | 199 | using QComboBox::insertItems; | ||
186 | 200 | | |||
187 | public Q_SLOTS: | 201 | public Q_SLOTS: | ||
188 | /** | 202 | /** | ||
189 | * Adds an item to the end of the history list and to the completion list. | 203 | * Adds an item to the end of the history list and to the completion list. | ||
190 | * If maxCount() is reached, the first item of the list will be | 204 | * If maxCount() is reached, the first item of the list will be | ||
191 | * removed. | 205 | * removed. | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |
Missing @since 5.66