KSystemClipboard Class

Clipboard access for unfocussed windows. More...

Header: #include <KSystemClipboard>
CMake: find_package(KF6 REQUIRED COMPONENTS GuiAddons)
target_link_libraries(mytarget PRIVATE KF6::GuiAddons)
Since: 5.89
Inherits: QObject

Public Functions

virtual void clear(QClipboard::Mode mode) = 0
virtual const QMimeData *mimeData(QClipboard::Mode mode) const = 0
virtual void setMimeData(QMimeData *mime, QClipboard::Mode mode) = 0
QString text(QClipboard::Mode mode)

Signals

void changed(QClipboard::Mode mode)

Static Public Members

KSystemClipboard *instance()

Detailed Description

This class mimics QClipboard but unlike QClipboard it will continue to get updates even when our window does not have focus.

This may require extra access permissions

Member Function Documentation

[signal] void KSystemClipboard::changed(QClipboard::Mode mode)

Emitted when the clipboard changes similar to QClipboard::changed

[pure virtual] void KSystemClipboard::clear(QClipboard::Mode mode)

Clears the current clipboard

[static] KSystemClipboard *KSystemClipboard::instance()

Returns a shared global SystemClipboard instance

[pure virtual] const QMimeData *KSystemClipboard::mimeData(QClipboard::Mode mode) const

Returns the current mime data received by the clipboard

See also setMimeData().

[pure virtual] void KSystemClipboard::setMimeData(QMimeData *mime, QClipboard::Mode mode)

Sets the clipboard to the new contents The clipboard takes ownership of mime

See also mimeData().

QString KSystemClipboard::text(QClipboard::Mode mode)

Returns the text content of the Clipboard

Similar to QClipboard::text(QClipboard::Mode mode)