Commit f2104a37 authored by Jean-Philippe André's avatar Jean-Philippe André

Extensions/Qt: use a QTextBrowser instead of QTextEdit

Now you can click on URLs
parent 3534ae61
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <QLabel> #include <QLabel>
#include <QPixmap> #include <QPixmap>
#include <QLineEdit> #include <QLineEdit>
#include <QTextEdit> #include <QTextBrowser>
#include <QCheckBox> #include <QCheckBox>
#include <QListWidget> #include <QListWidget>
#include <QComboBox> #include <QComboBox>
...@@ -205,7 +205,7 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget ) ...@@ -205,7 +205,7 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
{ {
QLabel *label = NULL; QLabel *label = NULL;
QPushButton *button = NULL; QPushButton *button = NULL;
QTextEdit *textArea = NULL; QTextBrowser *textArea = NULL;
QLineEdit *textInput = NULL; QLineEdit *textInput = NULL;
QCheckBox *checkBox = NULL; QCheckBox *checkBox = NULL;
QComboBox *comboBox = NULL; QComboBox *comboBox = NULL;
...@@ -242,9 +242,8 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget ) ...@@ -242,9 +242,8 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
return label; return label;
case EXTENSION_WIDGET_HTML: case EXTENSION_WIDGET_HTML:
textArea = new QTextEdit( this ); textArea = new QTextBrowser( this );
textArea->setAcceptRichText( true ); textArea->setOpenExternalLinks( true );
textArea->setReadOnly( true );
textArea->setHtml( qfu( p_widget->psz_text ) ); textArea->setHtml( qfu( p_widget->psz_text ) );
p_widget->p_sys_intf = textArea; p_widget->p_sys_intf = textArea;
return textArea; return textArea;
...@@ -547,7 +546,7 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget ) ...@@ -547,7 +546,7 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
{ {
QLabel *label = NULL; QLabel *label = NULL;
QPushButton *button = NULL; QPushButton *button = NULL;
QTextEdit *textArea = NULL; QTextBrowser *textArea = NULL;
QLineEdit *textInput = NULL; QLineEdit *textInput = NULL;
QCheckBox *checkBox = NULL; QCheckBox *checkBox = NULL;
QComboBox *comboBox = NULL; QComboBox *comboBox = NULL;
...@@ -578,7 +577,7 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget ) ...@@ -578,7 +577,7 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
return label; return label;
case EXTENSION_WIDGET_HTML: case EXTENSION_WIDGET_HTML:
textArea = static_cast< QTextEdit* >( p_widget->p_sys_intf ); textArea = static_cast< QTextBrowser* >( p_widget->p_sys_intf );
textArea->setHtml( qfu( p_widget->psz_text ) ); textArea->setHtml( qfu( p_widget->psz_text ) );
return textArea; return textArea;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment