mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Fix rendering of QStyle animations
Allocate a widget per NativeXXX. This way QStyleAnimation objects created by Qt aren't shared among style options. Fixes #2045 Fixes #2987
This commit is contained in:
parent
4a505c6788
commit
64f1504ab9
15 changed files with 252 additions and 49 deletions
|
@ -573,6 +573,22 @@ fn gen_backend_qt(
|
|||
.with_config(config)
|
||||
.with_crate(crate_dir)
|
||||
.with_include("slint_internal.h")
|
||||
.with_after_include(
|
||||
r"
|
||||
namespace slint::cbindgen_private {
|
||||
// HACK ALERT: This struct declaration is duplicated in internal/backend/qt/qt_widgets.rs - keep in sync.
|
||||
struct SlintTypeErasedWidget
|
||||
{
|
||||
virtual ~SlintTypeErasedWidget() = 0;
|
||||
SlintTypeErasedWidget(const SlintTypeErasedWidget&) = delete;
|
||||
SlintTypeErasedWidget& operator=(const SlintTypeErasedWidget&) = delete;
|
||||
|
||||
virtual void *qwidget() const = 0;
|
||||
};
|
||||
using SlintTypeErasedWidgetPtr = std::unique_ptr<SlintTypeErasedWidget>;
|
||||
}
|
||||
",
|
||||
)
|
||||
.with_trailer(gen_item_declarations(&items))
|
||||
.generate()
|
||||
.context("Unable to generate bindings for slint_qt_internal.h")?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue