KIO::JobUiDelegate Class

Header: #include <KIO/JobUiDelegate>
CMake: find_package(Qt6 REQUIRED COMPONENTS KIOWidgets)
target_link_libraries(mytarget PRIVATE Qt6::KIOWidgets)
Inherits: KIO::JobUiDelegateExtension and

Public Functions

virtual ~JobUiDelegate() override

Reimplemented Public Functions

virtual bool askDeleteConfirmation(const QList<QUrl> &urls, KIO::JobUiDelegateExtension::DeletionType deletionType, KIO::JobUiDelegateExtension::ConfirmationType confirmationType) override
virtual KIO::ClipboardUpdater *createClipboardUpdater(KIO::Job *job, KIO::JobUiDelegateExtension::ClipboardUpdaterMode mode) override
virtual void setWindow(QWidget *window) override
virtual void updateUrlInClipboard(const QUrl &src, const QUrl &dest) override

Static Public Members

void unregisterWindow(QWidget *window)

Protected Functions

JobUiDelegate(KJobUiDelegate::Flags flags = AutoHandlingDisabled, QWidget *window = nullptr, const QList<QObject *> &ifaces = {})

Detailed Description

A UI delegate tuned to be used with KIO Jobs.

Member Function Documentation

[explicit protected] JobUiDelegate::JobUiDelegate(KJobUiDelegate::Flags flags = AutoHandlingDisabled, QWidget *window = nullptr, const QList<QObject *> &ifaces = {})

Constructs a new KIO Job UI delegate. @param flags allows to enable automatic error/warning handling @param window the window associated with this delegate, see setWindow. @param ifaces Interface instances such as OpenWithHandlerInterface to replace the default interfaces @since 5.98

[override virtual noexcept] JobUiDelegate::~JobUiDelegate()

Destroys the KIO Job UI delegate.

[override virtual] bool JobUiDelegate::askDeleteConfirmation(const QList<QUrl> &urls, KIO::JobUiDelegateExtension::DeletionType deletionType, KIO::JobUiDelegateExtension::ConfirmationType confirmationType)

Reimplements: JobUiDelegateExtension::askDeleteConfirmation(const QList<QUrl> &urls, KIO::JobUiDelegateExtension::DeletionType deletionType, KIO::JobUiDelegateExtension::ConfirmationType confirmationType).

Ask for confirmation before deleting/trashing @p urls.

Note that this method is not called automatically by KIO jobs. It's the application's responsibility to ask the user for confirmation before calling KIO::del() or KIO::trash().

@param urls the urls about to be deleted/trashed @param deletionType the type of deletion (Delete for real deletion, Trash otherwise) @param confirmation see ConfirmationType. Normally set to DefaultConfirmation. Note: the window passed to setWindow is used as the parent for the message box. @return true if confirmed

[override virtual] KIO::ClipboardUpdater *JobUiDelegate::createClipboardUpdater(KIO::Job *job, KIO::JobUiDelegateExtension::ClipboardUpdaterMode mode)

Reimplements: JobUiDelegateExtension::createClipboardUpdater(KIO::Job *job, KIO::JobUiDelegateExtension::ClipboardUpdaterMode mode).

Creates a clipboard updater

[override virtual] void JobUiDelegate::setWindow(QWidget *window)

Associate this job with a window given by @p window. @param window the window to associate to @see window()

[static] void JobUiDelegate::unregisterWindow(QWidget *window)

Unregister the given window from kded. This is normally done automatically when the window is destroyed.

This method is useful for instance when keeping a hidden window around to make it faster to reuse later. @since 5.2

[override virtual] void JobUiDelegate::updateUrlInClipboard(const QUrl &src, const QUrl &dest)

Reimplements: JobUiDelegateExtension::updateUrlInClipboard(const QUrl &src, const QUrl &dest).

Update URL in clipboard, if present