mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Qt6: prevent QML object from being garbage collected
It appears that the QML object that is created when assigning the source to the StatsView in the ui can be garbage collected and therefore destroyed and re-instantiated without our knowledge. So instead of trying to keep a pointer around, we end up looking up the object address when needed. We still ask the JS code to not garbage collect the object - but that clearly isn't enough to prevent it from being destroyed when the parent widget changes. Without this fix opening the statistics will crash with Qt6. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2ede1a4563
commit
2368a183e1
2 changed files with 26 additions and 9 deletions
|
@ -31,7 +31,7 @@ slots:
|
|||
private:
|
||||
Ui::StatsWidget ui;
|
||||
StatsState state;
|
||||
StatsView *view;
|
||||
StatsView *getView();
|
||||
void updateUi();
|
||||
void updateRestrictionLabel();
|
||||
std::vector<std::unique_ptr<QCheckBox>> features;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue