diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2010-01-12 13:48:53 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-01-13 13:46:02 (GMT) |
commit | a78792ce877e549b6b19c64abc457bb3ce0e3d82 (patch) | |
tree | 7468416f9a2b6fc37c42859152b97dc75ca1ed7e | |
parent | e1b03bac22f87edbbe78eba366966259be6eb0ed (diff) | |
download | Qt-a78792ce877e549b6b19c64abc457bb3ce0e3d82.zip Qt-a78792ce877e549b6b19c64abc457bb3ce0e3d82.tar.gz Qt-a78792ce877e549b6b19c64abc457bb3ce0e3d82.tar.bz2 |
Use a QTextBrowser instead of a read only QTextEdit
... to display the extra text content. This works well on Maemo
and on S60, and has the added benefit that external URLs (like in
aboutQt) are opened correctly.
Reviewed-By: Jason Barron
-rw-r--r-- | src/gui/dialogs/qmessagebox.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 30892f2..d1b2e3f 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -58,6 +58,7 @@ #include <QtGui/qtextdocument.h> #include <QtGui/qapplication.h> #include <QtGui/qtextedit.h> +#include <QtGui/qtextbrowser.h> #include <QtGui/qmenu.h> #include "qdialog_p.h" #include <QtGui/qfont.h> @@ -188,8 +189,8 @@ public: bool autoAddOkButton; QAbstractButton *detectedEscapeButton; QLabel *informativeLabel; -#ifdef Q_OS_SYMBIAN - QTextEdit *textEdit; +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + QTextBrowser *textBrowser; #endif QPointer<QObject> receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; @@ -2462,12 +2463,12 @@ void QMessageBox::setInformativeText(const QString &text) #endif label->setWordWrap(true); QGridLayout *grid = static_cast<QGridLayout *>(layout()); -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) label->hide(); - QTextEdit *textEdit = new QTextEdit(this); - textEdit->setReadOnly(true); - grid->addWidget(textEdit, 1, 1, 1, 1); - d->textEdit = textEdit; + QTextBrowser *textBrowser = new QTextBrowser(this); + textBrowser->setOpenExternalLinks(true); + grid->addWidget(textBrowser, 1, 1, 1, 1); + d->textBrowser = textBrowser; #else grid->addWidget(label, 1, 1, 1, 1); #endif @@ -2475,9 +2476,9 @@ void QMessageBox::setInformativeText(const QString &text) } d->informativeLabel->setText(text); -#ifdef Q_OS_SYMBIAN - //We need to put the informative label inside textEdit to enable scrolling of long texts. - d->textEdit->setText(d->informativeLabel->text()); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + //We need to put the informative label inside textBrowser to enable scrolling of long texts. + d->textBrowser->setText(d->informativeLabel->text()); #endif d->updateSize(); |