From a107a277b945bd0da824005211c43535efccdf6d Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Wed, 11 Aug 2021 18:46:59 +0200 Subject: [PATCH] QmlDesigner: Fix for Annotation Table View Task-number: QDS-4636 Change-Id: I7eb31f58525264f763f06bed72636d1e9d905dc7 Reviewed-by: Aleksei German --- .../components/annotationeditor/annotationtableview.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationtableview.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationtableview.cpp index b074a3dc48f..50c3f008382 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationtableview.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationtableview.cpp @@ -357,14 +357,16 @@ QVector AnnotationTableView::fetchComments() const Comment AnnotationTableView::fetchComment(int row) const { - auto *item = m_model->item(row, ColumnId::Title); - if (item->text().isEmpty()) + const auto *item = m_model->item(row, ColumnId::Title); + Comment comment = item->data().value(); + + if (comment.isEmpty()) return {}; - Comment comment = item->data().value(); comment.setTitle(item->text()); comment.setAuthor(m_model->item(row, ColumnId::Author)->text()); comment.setText(dataToCommentText(m_model->item(row, ColumnId::Value)->data(Qt::DisplayRole))); + return comment; }