From a43868ca114562502618b4e9c3dd096c65c2e192 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 16 Dec 2009 12:17:41 +0200 Subject: Long informative texts causes messagebox to grow outside of screen area Currently if we launch QMessageBox::aboutQt(), the dialog grows too large to fit into any kind of device display. To fix this, we have added a QTextEdit instead of QLabel into QMessageBox. QTextEdit automatically adds scrollbars to its content, if the text won't fit into the designated area. This change causes error QTBUG-6853. This is due to that QTextEdit does not support activating external links. Task-number: QTBUG-3232 Reviewed-by: Alessandro Portale --- src/gui/dialogs/qmessagebox.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index a318c43..8ec8d1c 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -188,6 +188,9 @@ public: bool autoAddOkButton; QAbstractButton *detectedEscapeButton; QLabel *informativeLabel; +#ifdef Q_OS_SYMBIAN + QTextEdit *textEdit; +#endif QPointer receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; QByteArray signalToDisconnectOnClose; @@ -2459,10 +2462,24 @@ void QMessageBox::setInformativeText(const QString &text) #endif label->setWordWrap(true); QGridLayout *grid = static_cast(layout()); +#ifdef Q_OS_SYMBIAN + label->hide(); + QTextEdit *textEdit = new QTextEdit(this); + textEdit->setReadOnly(true); + grid->addWidget(textEdit, 1, 1, 1, 1); + d->textEdit = textEdit; +#else grid->addWidget(label, 1, 1, 1, 1); +#endif d->informativeLabel = label; } 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()); +#endif + d->updateSize(); } -- cgit v0.12