summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2021-12-15 13:57:43 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-15 15:21:36 +0000
commit6ef406ab1b4c731fb7d8cfcc68a70ac490ea10b3 (patch)
tree005a816b63b52fcf7905eff1a8c99ebf8cfe7806
parente926d440cbca0c0996acaab265b483fb1ae4aa99 (diff)
Qt Linguist: Fix 'QObject: Q_ASSERT the object type before calling a PMF'
Make sure you disconnect the signal, otherwise it will be triggered when the child widget is destroyed, while the editor is already half-destructed. Fixes: QTBUG-99232 Change-Id: I5556b6cc200a58010cab8fa2458b5c3604cbc783 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ff2685d5a07f43b9618cb508ff193e6554e08cc0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/linguist/linguist/messageeditor.cpp6
-rw-r--r--src/linguist/linguist/messageeditor.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/linguist/linguist/messageeditor.cpp b/src/linguist/linguist/messageeditor.cpp
index 1a126da7a..dfc0982fe 100644
--- a/src/linguist/linguist/messageeditor.cpp
+++ b/src/linguist/linguist/messageeditor.cpp
@@ -107,6 +107,12 @@ MessageEditor::MessageEditor(MultiDataModel *dataModel, QMainWindow *parent)
showNothing();
}
+MessageEditor::~MessageEditor()
+{
+ if (FormatTextEdit *fte = qobject_cast<FormatTextEdit *>(m_selectionHolder))
+ disconnect(fte, &FormatTextEdit::editorDestroyed, this, &MessageEditor::editorDestroyed);
+}
+
void MessageEditor::setupEditorPage()
{
QFrame *editorPage = new QFrame;
diff --git a/src/linguist/linguist/messageeditor.h b/src/linguist/linguist/messageeditor.h
index 1a16ff1d5..503eb342e 100644
--- a/src/linguist/linguist/messageeditor.h
+++ b/src/linguist/linguist/messageeditor.h
@@ -64,6 +64,7 @@ class MessageEditor : public QScrollArea
public:
MessageEditor(MultiDataModel *dataModel, QMainWindow *parent = 0);
+ ~MessageEditor();
void showNothing();
void showMessage(const MultiDataIndex &index);