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:
Tim Jenßen
2025-03-26 10:52:13 +01:00
committed by Tim Jenssen
parent e9f76460ab
commit 5b55cb605c
2 changed files with 4 additions and 3 deletions

View File

@@ -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()

View File

@@ -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;
}; };