feature:display dictionary description as html

This commit is contained in:
Xiao YiFang 2023-03-19 10:46:48 +08:00 committed by xiaoyifang
parent 8bfc0fee23
commit e4ccf1b378
2 changed files with 6 additions and 6 deletions

View file

@ -48,8 +48,11 @@ void DictInfo::showInfo( sptr<Dictionary::Class> dict )
QString info = dict->getDescription(); QString info = dict->getDescription();
if( !info.isEmpty() && info.compare( "NONE" ) != 0 ) if( !info.isEmpty() && info.compare( "NONE" ) != 0 ) {
ui.infoLabel->setPlainText( info ); //qtbug QTBUG-112020
info.remove( QRegularExpression( R"(<link[^>]*>)", QRegularExpression::CaseInsensitiveOption ) );
ui.infoLabel->setHtml( info );
}
else else
ui.infoLabel->clear(); ui.infoLabel->clear();

View file

@ -176,16 +176,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPlainTextEdit" name="infoLabel"> <widget class="QTextEdit" name="infoLabel">
<property name="toolTip"> <property name="toolTip">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="horizontalScrollBarPolicy"> <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>