Class Platform#
Defined in File slint-platform.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class Platform#
The platform acts as a factory to create WindowAdapter instances.
Call slint::platform::set_platform() before creating any other Slint handles. Any subsequently created Slint windows will use the WindowAdapter provided by the create_window_adapter function.
Public Types
-
enum class Clipboard#
The type of clipboard used in Platform::clipboard_text and PLatform::set_clipboard_text.
Values:
-
enumerator DefaultClipboard#
This is the default clipboard used for text action for Ctrl+V, Ctrl+C. Corresponds to the secondary selection on X11.
-
enumerator DefaultClipboard#
Public Functions
-
virtual ~Platform() = default#
-
Platform() = default#
-
virtual std::unique_ptr<WindowAdapter> create_window_adapter() = 0#
Returns a new WindowAdapter.
-
virtual std::chrono::milliseconds duration_since_start() = 0#
Returns the amount of milliseconds since start of the application.
This function should only be implemented if the runtime is compiled with SLINT_FEATURE_FREESTANDING
Sends the given text into the system clipboard.
If the platform doesn’t support the specified clipboard, this function should do nothing
-
inline virtual std::optional<SharedString> clipboard_text(Clipboard)#
Returns a copy of text stored in the system clipboard, if any.
If the platform doesn’t support the specified clipboard, the function should return nullopt
-
inline virtual void run_event_loop()#
Spins an event loop and renders the visible windows.
-
inline virtual void quit_event_loop()#
Exits the event loop.
This is what is called by slint::quit_event_loop() and can be called from a different thread or re-enter from the event loop
-
inline virtual void run_in_event_loop(Task)#
Run a task from the event loop.
This function is called by slint::invoke_from_event_loop(). It can be called from any thread, but the passed function must only be called from the event loop. Reimplements this function and move the event to the event loop before calling Task::run()
-
class Task#
An task that is passed to the Platform::run_in_event_loop function and needs to be run in the event loop and not in any other thread.
-
enum class Clipboard#