File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ QWidget *QgsTextEditWrapper::createWidget( QWidget *parent )
100
100
101
101
void QgsTextEditWrapper::initWidget ( QWidget *editor )
102
102
{
103
- mTextEdit = qobject_cast<QTextBrowser *>( editor );
103
+ mTextBrowser = qobject_cast<QTextBrowser *>( editor );
104
+ mTextEdit = qobject_cast<QTextEdit *>( editor );
104
105
mPlainTextEdit = qobject_cast<QPlainTextEdit *>( editor );
105
106
mLineEdit = qobject_cast<QLineEdit *>( editor );
106
107
@@ -225,8 +226,11 @@ void QgsTextEditWrapper::setWidgetValue( const QVariant &val )
225
226
if ( config ( QStringLiteral ( " UseHtml" ) ).toBool () )
226
227
{
227
228
mTextEdit ->setHtml ( v );
228
- mTextEdit ->setTextInteractionFlags ( Qt::LinksAccessibleByMouse );
229
- mTextEdit ->setOpenExternalLinks ( true );
229
+ if ( mTextBrowser )
230
+ {
231
+ mTextBrowser ->setTextInteractionFlags ( Qt::LinksAccessibleByMouse );
232
+ mTextBrowser ->setOpenExternalLinks ( true );
233
+ }
230
234
}
231
235
else
232
236
mTextEdit ->setPlainText ( v );
Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
68
68
void textChanged ( const QString &text );
69
69
70
70
private:
71
- QTextBrowser *mTextEdit = nullptr ;
71
+ QTextBrowser *mTextBrowser = nullptr ;
72
+ QTextEdit *mTextEdit = nullptr ;
72
73
QPlainTextEdit *mPlainTextEdit = nullptr ;
73
74
QLineEdit *mLineEdit = nullptr ;
74
75
QPalette mReadOnlyPalette ;
You can’t perform that action at this time.
0 commit comments