mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Fix tablet button crash
This commit is contained in:
parent
d572510770
commit
3d0c13915a
1 changed files with 6 additions and 0 deletions
|
@ -825,7 +825,13 @@ TabletButtonProxy::~TabletButtonProxy() {
|
||||||
|
|
||||||
void TabletButtonProxy::setQmlButton(QQuickItem* qmlButton) {
|
void TabletButtonProxy::setQmlButton(QQuickItem* qmlButton) {
|
||||||
Q_ASSERT(QThread::currentThread() == qApp->thread());
|
Q_ASSERT(QThread::currentThread() == qApp->thread());
|
||||||
|
if (_qmlButton) {
|
||||||
|
QObject::disconnect(_qmlButton, &QQuickItem::destroyed, this, nullptr);
|
||||||
|
}
|
||||||
_qmlButton = qmlButton;
|
_qmlButton = qmlButton;
|
||||||
|
if (_qmlButton) {
|
||||||
|
QObject::connect(_qmlButton, &QQuickItem::destroyed, this, [this] { _qmlButton = nullptr; });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabletButtonProxy::setToolbarButtonProxy(QObject* toolbarButtonProxy) {
|
void TabletButtonProxy::setToolbarButtonProxy(QObject* toolbarButtonProxy) {
|
||||||
|
|
Loading…
Reference in a new issue