Skip to content

DataTransfer

from slint import DataTransfer
python

Represents some form of type-indexed possibly-lazy data transfer.

Used for accessing the platform clipboard and drag-and-drop APIs.

plain_text: Optional[str]

The plain text representation of this DataTransfer, or None if no plain text is available. Assigning None or the empty string clears any previously-set plain text; assigning any other string overwrites it.

has_plain_text: bool

True if this DataTransfer advertises a plain text representation.

image: Optional[Image]

The image representation of this DataTransfer, or None if no image is available. Assigning None clears any previously-set image; assigning any other image overwrites it.

has_image: bool

True if this DataTransfer advertises an image representation.

is_empty: bool

True if this DataTransfer carries no data: no plain text, no image, and no user data.

user_data: Optional[object]

Application-internal user data attached to this DataTransfer. Use this when the drag-and-drop or clipboard operation stays inside the current Python application and you want to avoid serializing to plain text or an image.

Reading returns the Python object previously assigned, or None if none was set (or the user data was set by a non-Python binding). Assigning None clears any previously attached Python user data.


© 2026 SixtyFPS GmbH