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 )
8585 {
8686 if ( config ( QStringLiteral ( " UseHtml" ) ).toBool () )
8787 {
88- return new QTextEdit ( parent );
88+ return new QTextBrowser ( parent );
8989 }
9090 else
9191 {
@@ -100,7 +100,7 @@ QWidget *QgsTextEditWrapper::createWidget( QWidget *parent )
100100
101101void QgsTextEditWrapper::initWidget ( QWidget *editor )
102102{
103- mTextEdit = qobject_cast<QTextEdit *>( editor );
103+ mTextEdit = qobject_cast<QTextBrowser *>( editor );
104104 mPlainTextEdit = qobject_cast<QPlainTextEdit *>( editor );
105105 mLineEdit = qobject_cast<QLineEdit *>( editor );
106106
@@ -223,7 +223,11 @@ void QgsTextEditWrapper::setWidgetValue( const QVariant &val )
223223 if ( val != value () )
224224 {
225225 if ( config ( QStringLiteral ( " UseHtml" ) ).toBool () )
226+ {
226227 mTextEdit ->setHtml ( v );
228+ mTextEdit ->setTextInteractionFlags ( Qt::LinksAccessibleByMouse );
229+ mTextEdit ->setOpenExternalLinks ( true );
230+ }
227231 else
228232 mTextEdit ->setPlainText ( v );
229233 }
Original file line number Diff line number Diff line change 2020
2121#include < QLineEdit>
2222#include < QPlainTextEdit>
23- #include < QTextEdit >
23+ #include < QTextBrowser >
2424#include " qgis_gui.h"
2525
2626SIP_NO_FILE
@@ -68,7 +68,7 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
6868 void textChanged ( const QString &text );
6969
7070 private:
71- QTextEdit *mTextEdit = nullptr ;
71+ QTextBrowser *mTextEdit = nullptr ;
7272 QPlainTextEdit *mPlainTextEdit = nullptr ;
7373 QLineEdit *mLineEdit = nullptr ;
7474 QPalette mReadOnlyPalette ;
You can’t perform that action at this time.
0 commit comments