QmlDesigner: Fix for Annotation Table View

Task-number: QDS-4636
Change-Id: I7eb31f58525264f763f06bed72636d1e9d905dc7
Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
Aleksei German
2021-08-11 18:46:59 +02:00
parent aef13a5dcd
commit a107a277b9

View File

@@ -357,14 +357,16 @@ QVector<Comment> AnnotationTableView::fetchComments() const
Comment AnnotationTableView::fetchComment(int row) const Comment AnnotationTableView::fetchComment(int row) const
{ {
auto *item = m_model->item(row, ColumnId::Title); const auto *item = m_model->item(row, ColumnId::Title);
if (item->text().isEmpty()) Comment comment = item->data().value<Comment>();
if (comment.isEmpty())
return {}; return {};
Comment comment = item->data().value<Comment>();
comment.setTitle(item->text()); comment.setTitle(item->text());
comment.setAuthor(m_model->item(row, ColumnId::Author)->text()); comment.setAuthor(m_model->item(row, ColumnId::Author)->text());
comment.setText(dataToCommentText(m_model->item(row, ColumnId::Value)->data(Qt::DisplayRole))); comment.setText(dataToCommentText(m_model->item(row, ColumnId::Value)->data(Qt::DisplayRole)));
return comment; return comment;
} }