forked from qt-creator/qt-creator
QmlDesigner: fix shutdown crash
- m_dialog is already deleted by the parent, found in sentry
https://the-qt-company-00.sentry.io/issues/6138135652/
- also fix a clazy warning in the connects
Change-Id: Icd8731f2d7863d18af2e9e834223c95f6d99a1f6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit 6777c3f0da
)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
@@ -34,8 +34,8 @@ RichTextEditorProxy::RichTextEditorProxy(QObject *parent)
|
|||||||
|
|
||||||
m_dialog->setLayout(layout);
|
m_dialog->setLayout(layout);
|
||||||
|
|
||||||
connect(m_dialog, &QDialog::accepted, [this] { emit accepted(); });
|
connect(m_dialog, &QDialog::accepted, this, &RichTextEditorProxy::accepted);
|
||||||
connect(m_dialog, &QDialog::rejected, [this] { emit rejected(); });
|
connect(m_dialog, &QDialog::rejected, this, &RichTextEditorProxy::rejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
RichTextEditorProxy::~RichTextEditorProxy()
|
RichTextEditorProxy::~RichTextEditorProxy()
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QPointer>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -36,7 +37,7 @@ signals:
|
|||||||
void rejected();
|
void rejected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDialog *m_dialog;
|
QPointer<QDialog> m_dialog;
|
||||||
RichTextEditor *m_widget;
|
RichTextEditor *m_widget;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user