From 1c1483af7df425f276b6e37546d1926d07826e7a Mon Sep 17 00:00:00 2001 From: w15dev Date: Thu, 9 Jan 2025 19:33:40 +0300 Subject: [PATCH] Fix read-only preview Refactor EntryAttachmentsWidget and PreviewEntryAttachmentsDialog to remove unnecessary parent references Fixes #11506 --- src/gui/entry/EntryAttachmentsWidget.cpp | 4 ++-- src/gui/entry/PreviewEntryAttachmentsDialog.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/entry/EntryAttachmentsWidget.cpp b/src/gui/entry/EntryAttachmentsWidget.cpp index c1688153a5..784c1f0202 100644 --- a/src/gui/entry/EntryAttachmentsWidget.cpp +++ b/src/gui/entry/EntryAttachmentsWidget.cpp @@ -175,7 +175,7 @@ void EntryAttachmentsWidget::newAttachments() return; } - NewEntryAttachmentsDialog newEntryDialog{m_entryAttachments, this}; + NewEntryAttachmentsDialog newEntryDialog{m_entryAttachments}; if (newEntryDialog.exec() == QDialog::Accepted) { emit widgetUpdated(); } @@ -191,7 +191,7 @@ void EntryAttachmentsWidget::previewAttachments() return; } - PreviewEntryAttachmentsDialog previewDialog{m_entryAttachments, this}; + PreviewEntryAttachmentsDialog previewDialog{m_entryAttachments}; previewDialog.setAttachment(m_attachmentsModel->keyByIndex(index)); previewDialog.exec(); diff --git a/src/gui/entry/PreviewEntryAttachmentsDialog.cpp b/src/gui/entry/PreviewEntryAttachmentsDialog.cpp index 51d1180611..91ddb16737 100644 --- a/src/gui/entry/PreviewEntryAttachmentsDialog.cpp +++ b/src/gui/entry/PreviewEntryAttachmentsDialog.cpp @@ -37,6 +37,7 @@ PreviewEntryAttachmentsDialog::PreviewEntryAttachmentsDialog(QPointertitleEdit->setReadOnly(true); m_ui->attachmentTextEdit->setReadOnly(true); + m_ui->errorLabel->setVisible(false); m_ui->dialogButtons->clear(); m_ui->dialogButtons->addButton(QDialogButtonBox::Close);