mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
Guard tutorial step target widgets with QPointer
This commit is contained in:
parent
9c0c480b2e
commit
b6b862cad7
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <functional>
|
||||
|
||||
enum class ValidationTiming
|
||||
|
|
@ -19,7 +20,8 @@ class TutorialController;
|
|||
|
||||
struct TutorialStep
|
||||
{
|
||||
QWidget *targetWidget = nullptr;
|
||||
// QPointer so a destroyed widget is detected instead of dereferencing a dangling pointer.
|
||||
QPointer<QWidget> targetWidget;
|
||||
QString text;
|
||||
std::function<void()> onEnter = nullptr;
|
||||
std::function<void()> onExit = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue