Skip to content

Commit

Permalink
Fix incorrect annotation HTML shown when clicking between annotations
Browse files Browse the repository at this point in the history
and HTML source view is enabled
  • Loading branch information
nyalldawson committed Jan 29, 2025
1 parent e1e3743 commit e1c6040
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/gui/qgsrichtexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,16 +752,20 @@ void QgsRichTextEditor::setText( const QString &text )
{
if ( text.isEmpty() )
{
setPlainText( text );
mTextEdit->setPlainText( text );
mSourceEdit->clear();
return;
}

if ( text[0] == '<' )
{
setHtml( text );
mTextEdit->setHtml( text );
mSourceEdit->setText( text );
}
else
{
setPlainText( text );
mTextEdit->setPlainText( text );
mSourceEdit->setText( text );
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsrichtexteditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ class GUI_EXPORT QgsRichTextEditor : public QWidget, protected Ui::QgsRichTextEd
void focusInEvent( QFocusEvent *event ) override;

private slots:
void setPlainText( const QString &text ) { mTextEdit->setPlainText( text ); }
void setHtml( const QString &text ) { mTextEdit->setHtml( text ); }
void textRemoveFormat();
void textRemoveAllFormat();
void textBold();
Expand Down

0 comments on commit e1c6040

Please sign in to comment.