The icon dialog can now be closed on request
This commit is contained in:
parent
f53a976ae7
commit
04bf0ddaed
@ -57,6 +57,14 @@ QString IconDialog::openDialog()
|
|||||||
return dialog->openDialog();
|
return dialog->openDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IconDialog::closeDialog()
|
||||||
|
{
|
||||||
|
if (d->dialog) {
|
||||||
|
auto dialog = d->dialog.instance();
|
||||||
|
dialog->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IconDialog::~IconDialog()
|
IconDialog::~IconDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
~IconDialog();
|
~IconDialog();
|
||||||
|
|
||||||
Q_INVOKABLE QString openDialog();
|
Q_INVOKABLE QString openDialog();
|
||||||
|
Q_INVOKABLE void closeDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
D_PTR;
|
D_PTR;
|
||||||
|
@ -41,6 +41,11 @@ public:
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator bool() const
|
||||||
|
{
|
||||||
|
return !s_instance.expired();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::weak_ptr<Target> s_instance;
|
static std::weak_ptr<Target> s_instance;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user