Skip to content
Permalink
Browse files

Ensure compatibility with QTextEdit

  • Loading branch information
m-kuhn committed Apr 5, 2018
1 parent 3c7b74f commit 5ad16332d97544596aae973490bf0bc010c841bf
Showing with 9 additions and 4 deletions.
  1. +7 −3 src/gui/editorwidgets/qgstexteditwrapper.cpp
  2. +2 −1 src/gui/editorwidgets/qgstexteditwrapper.h
@@ -100,7 +100,8 @@ QWidget *QgsTextEditWrapper::createWidget( QWidget *parent )

void QgsTextEditWrapper::initWidget( QWidget *editor )
{
mTextEdit = qobject_cast<QTextBrowser *>( editor );
mTextBrowser = qobject_cast<QTextBrowser *>( editor );
mTextEdit = qobject_cast<QTextEdit *>( editor );
mPlainTextEdit = qobject_cast<QPlainTextEdit *>( editor );
mLineEdit = qobject_cast<QLineEdit *>( editor );

@@ -225,8 +226,11 @@ void QgsTextEditWrapper::setWidgetValue( const QVariant &val )
if ( config( QStringLiteral( "UseHtml" ) ).toBool() )
{
mTextEdit->setHtml( v );
mTextEdit->setTextInteractionFlags( Qt::LinksAccessibleByMouse );
mTextEdit->setOpenExternalLinks( true );
if ( mTextBrowser )
{
mTextBrowser->setTextInteractionFlags( Qt::LinksAccessibleByMouse );
mTextBrowser->setOpenExternalLinks( true );
}
}
else
mTextEdit->setPlainText( v );
@@ -68,7 +68,8 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
void textChanged( const QString &text );

private:
QTextBrowser *mTextEdit = nullptr;
QTextBrowser *mTextBrowser = nullptr;
QTextEdit *mTextEdit = nullptr;
QPlainTextEdit *mPlainTextEdit = nullptr;
QLineEdit *mLineEdit = nullptr;
QPalette mReadOnlyPalette;

0 comments on commit 5ad1633

Please sign in to comment.
You can’t perform that action at this time.