File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ QWidget *QgsTextEditWrapper::createWidget( QWidget *parent )
85
85
{
86
86
if ( config ( QStringLiteral ( " UseHtml" ) ).toBool () )
87
87
{
88
- return new QTextEdit ( parent );
88
+ return new QTextBrowser ( parent );
89
89
}
90
90
else
91
91
{
@@ -100,7 +100,7 @@ QWidget *QgsTextEditWrapper::createWidget( QWidget *parent )
100
100
101
101
void QgsTextEditWrapper::initWidget ( QWidget *editor )
102
102
{
103
- mTextEdit = qobject_cast<QTextEdit *>( editor );
103
+ mTextEdit = qobject_cast<QTextBrowser *>( editor );
104
104
mPlainTextEdit = qobject_cast<QPlainTextEdit *>( editor );
105
105
mLineEdit = qobject_cast<QLineEdit *>( editor );
106
106
@@ -223,7 +223,11 @@ void QgsTextEditWrapper::setWidgetValue( const QVariant &val )
223
223
if ( val != value () )
224
224
{
225
225
if ( config ( QStringLiteral ( " UseHtml" ) ).toBool () )
226
+ {
226
227
mTextEdit ->setHtml ( v );
228
+ mTextEdit ->setTextInteractionFlags ( Qt::LinksAccessibleByMouse );
229
+ mTextEdit ->setOpenExternalLinks ( true );
230
+ }
227
231
else
228
232
mTextEdit ->setPlainText ( v );
229
233
}
Original file line number Diff line number Diff line change 20
20
21
21
#include < QLineEdit>
22
22
#include < QPlainTextEdit>
23
- #include < QTextEdit >
23
+ #include < QTextBrowser >
24
24
#include " qgis_gui.h"
25
25
26
26
SIP_NO_FILE
@@ -68,7 +68,7 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
68
68
void textChanged ( const QString &text );
69
69
70
70
private:
71
- QTextEdit *mTextEdit = nullptr ;
71
+ QTextBrowser *mTextEdit = nullptr ;
72
72
QPlainTextEdit *mPlainTextEdit = nullptr ;
73
73
QLineEdit *mLineEdit = nullptr ;
74
74
QPalette mReadOnlyPalette ;
You can’t perform that action at this time.
0 commit comments