mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
C++: make Platform::duration_since_start non-const and pure
When SLINT_FEATURE_FREESTANDING is set, it must be re-implemented otherwise the time doesn't pass
This commit is contained in:
parent
c47e6cd029
commit
932db7ac38
3 changed files with 5 additions and 8 deletions
|
@ -343,10 +343,7 @@ public:
|
|||
///
|
||||
/// This function should only be implemented if the runtime is compiled with
|
||||
/// SLINT_FEATURE_FREESTANDING
|
||||
virtual std::chrono::milliseconds duration_since_start() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
virtual std::chrono::milliseconds duration_since_start() = 0;
|
||||
#endif
|
||||
|
||||
/// The type of clipboard used in Platform::clipboard_text and PLatform::set_clipboard_text.
|
||||
|
@ -449,7 +446,7 @@ inline void set_platform(std::unique_ptr<Platform> platform)
|
|||
#ifndef SLINT_FEATURE_FREESTANDING
|
||||
return 0;
|
||||
#else
|
||||
return reinterpret_cast<const Platform *>(p)->duration_since_start().count();
|
||||
return reinterpret_cast<Platform *>(p)->duration_since_start().count();
|
||||
#endif
|
||||
},
|
||||
[](void *p, const SharedString *text, cbindgen_private::Clipboard clipboard) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue