Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kurlrequester.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | |||||
59 | */ | 59 | */ | ||
60 | class KIOWIDGETS_EXPORT KUrlRequester : public QWidget | 60 | class KIOWIDGETS_EXPORT KUrlRequester : public QWidget | ||
61 | { | 61 | { | ||
62 | Q_OBJECT | 62 | Q_OBJECT | ||
63 | Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY textChanged USER true) | 63 | Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY textChanged USER true) | ||
64 | Q_PROPERTY(QString filter READ filter WRITE setFilter) | 64 | Q_PROPERTY(QString filter READ filter WRITE setFilter) | ||
65 | Q_PROPERTY(KFile::Modes mode READ mode WRITE setMode) | 65 | Q_PROPERTY(KFile::Modes mode READ mode WRITE setMode) | ||
66 | Q_PROPERTY(QFileDialog::AcceptMode acceptMode READ acceptMode WRITE setAcceptMode) | 66 | Q_PROPERTY(QFileDialog::AcceptMode acceptMode READ acceptMode WRITE setAcceptMode) | ||
67 | #ifndef KIOWIDGETS_NO_DEPRECATED | 67 | /// @deprecated Since 5.0, use placeholderText | ||
68 | Q_PROPERTY(QString clickMessage READ clickMessage WRITE setClickMessage) | 68 | Q_PROPERTY(QString clickMessage READ clickMessage WRITE setClickMessage) | ||
69 | #endif | | |||
70 | Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText) | 69 | Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText) | ||
71 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) | 70 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) | ||
72 | Q_PROPERTY(Qt::WindowModality fileDialogModality READ fileDialogModality WRITE setFileDialogModality) | 71 | Q_PROPERTY(Qt::WindowModality fileDialogModality READ fileDialogModality WRITE setFileDialogModality) | ||
73 | 72 | | |||
74 | public: | 73 | public: | ||
75 | /** | 74 | /** | ||
76 | * Constructs a KUrlRequester widget. | 75 | * Constructs a KUrlRequester widget. | ||
77 | */ | 76 | */ | ||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | |||||
175 | * You can use this to customize the dialog, e.g. to call setLocationLabel | 174 | * You can use this to customize the dialog, e.g. to call setLocationLabel | ||
176 | * or other things which are not accessible in the KUrlRequester API. | 175 | * or other things which are not accessible in the KUrlRequester API. | ||
177 | * | 176 | * | ||
178 | * Never returns 0. This method creates the file dialog on demand. | 177 | * Never returns 0. This method creates the file dialog on demand. | ||
179 | * | 178 | * | ||
180 | * @deprecated since 5.0. The dialog will be created anyway when the user | 179 | * @deprecated since 5.0. The dialog will be created anyway when the user | ||
181 | * requests it, and will behave according to the properties of KUrlRequester. | 180 | * requests it, and will behave according to the properties of KUrlRequester. | ||
182 | */ | 181 | */ | ||
183 | #ifndef KIOWIDGETS_NO_DEPRECATED | 182 | KIOWIDGETS_DEPRECATED_VERSION(5, 0, "See API docs") | ||
184 | virtual KIOWIDGETS_DEPRECATED QFileDialog *fileDialog() const; | 183 | virtual QFileDialog *fileDialog() const; | ||
185 | #endif | | |||
186 | 184 | | |||
187 | /** | 185 | /** | ||
188 | * @returns a pointer to the lineedit, either the default one, or the | 186 | * @returns a pointer to the lineedit, either the default one, or the | ||
189 | * special one, if you used the special constructor. | 187 | * special one, if you used the special constructor. | ||
190 | * | 188 | * | ||
191 | * It is provided so that you can e.g. set an own completion object | 189 | * It is provided so that you can e.g. set an own completion object | ||
192 | * (e.g. KShellCompletion) into it. | 190 | * (e.g. KShellCompletion) into it. | ||
193 | */ | 191 | */ | ||
Show All 23 Lines | |||||
217 | * \code | 215 | * \code | ||
218 | * KUrlRequester *req = new KUrlRequester( someWidget ); | 216 | * KUrlRequester *req = new KUrlRequester( someWidget ); | ||
219 | * [...] | 217 | * [...] | ||
220 | * KEditListWidget *editListWidget = new KEditListWidget( req->customEditor(), someWidget ); | 218 | * KEditListWidget *editListWidget = new KEditListWidget( req->customEditor(), someWidget ); | ||
221 | * \endcode | 219 | * \endcode | ||
222 | */ | 220 | */ | ||
223 | const KEditListWidget::CustomEditor &customEditor(); | 221 | const KEditListWidget::CustomEditor &customEditor(); | ||
224 | 222 | | |||
223 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
225 | /** | 224 | /** | ||
226 | * @returns the message set with setClickMessage | 225 | * @returns the message set with setClickMessage | ||
227 | * @since 4.2 | 226 | * @since 4.2 | ||
228 | * @deprecated use KUrlRequester::placeholderText instead. | 227 | * @deprecated Since 5.0, use KUrlRequester::placeholderText instead. | ||
229 | */ | 228 | */ | ||
230 | #ifndef KIOWIDGETS_NO_DEPRECATED | 229 | KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KUrlRequester::placeholderText()") | ||
231 | KIOWIDGETS_DEPRECATED QString clickMessage() const; | 230 | QString clickMessage() const; | ||
232 | #endif | 231 | #endif | ||
233 | 232 | | |||
233 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
234 | /** | 234 | /** | ||
235 | * Set a click message @p msg | 235 | * Set a click message @p msg | ||
236 | * @since 4.2 | 236 | * @since 4.2 | ||
237 | * @deprecated use KUrlRequester::setPlaceholderText instead. | 237 | * @deprecated Since 5.0, use KUrlRequester::setPlaceholderText instead. | ||
238 | */ | 238 | */ | ||
239 | #ifndef KIOWIDGETS_NO_DEPRECATED | 239 | KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KUrlRequester::setPlaceholderText(const QString&)") | ||
240 | KIOWIDGETS_DEPRECATED void setClickMessage(const QString &msg); | 240 | void setClickMessage(const QString &msg); | ||
241 | #endif | 241 | #endif | ||
242 | 242 | | |||
243 | /** | 243 | /** | ||
244 | * @return the message set with setPlaceholderText | 244 | * @return the message set with setPlaceholderText | ||
245 | * @since 5.0 | 245 | * @since 5.0 | ||
246 | */ | 246 | */ | ||
247 | QString placeholderText() const; | 247 | QString placeholderText() const; | ||
248 | 248 | | |||
Show All 26 Lines | 270 | public Q_SLOTS: | |||
275 | 275 | | |||
276 | /** | 276 | /** | ||
277 | * Sets the start dir @p startDir. | 277 | * Sets the start dir @p startDir. | ||
278 | * The start dir is only used when the URL isn't set. | 278 | * The start dir is only used when the URL isn't set. | ||
279 | * @since 4.3 | 279 | * @since 4.3 | ||
280 | */ | 280 | */ | ||
281 | void setStartDir(const QUrl &startDir); | 281 | void setStartDir(const QUrl &startDir); | ||
282 | 282 | | |||
283 | #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 3) | ||||
283 | /** | 284 | /** | ||
284 | * Sets the url in the lineedit to @p QUrl::fromLocalFile(path). | 285 | * Sets the url in the lineedit to @p QUrl::fromLocalFile(path). | ||
285 | * This is only for local paths; do not pass a url here. | 286 | * This is only for local paths; do not pass a url here. | ||
286 | * This method is mostly for "local paths only" url requesters, | 287 | * This method is mostly for "local paths only" url requesters, | ||
287 | * for instance those set up with setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly) | 288 | * for instance those set up with setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly) | ||
288 | * | 289 | * | ||
289 | * @deprecated Use setUrl(QUrl::fromLocalFile(path)) instead. | 290 | * @deprecated Since 4.3. Use setUrl(QUrl::fromLocalFile(path)) instead. | ||
290 | */ | 291 | */ | ||
291 | #ifndef KIOWIDGETS_NO_DEPRECATED | 292 | KIOWIDGETS_DEPRECATED_VERSION(4, 3, "Use KUrlRequester::setUrlQUrl::fromLocalFile(path))") | ||
292 | KIOWIDGETS_DEPRECATED void setPath(const QString &path); | 293 | void setPath(const QString &path); | ||
293 | #endif | 294 | #endif | ||
294 | 295 | | |||
295 | /** | 296 | /** | ||
296 | * Sets the current text in the lineedit or combobox. | 297 | * Sets the current text in the lineedit or combobox. | ||
297 | * This is used for cases where KUrlRequester is used to | 298 | * This is used for cases where KUrlRequester is used to | ||
298 | * enter URL-or-something-else, like KOpenWithDialog where you | 299 | * enter URL-or-something-else, like KOpenWithDialog where you | ||
299 | * can type a full command with arguments. | 300 | * can type a full command with arguments. | ||
300 | * | 301 | * | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |