diff options
author | Sami Merila <sami.merila@nokia.com> | 2009-12-16 10:17:41 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2009-12-16 10:17:41 (GMT) |
commit | a43868ca114562502618b4e9c3dd096c65c2e192 (patch) | |
tree | 7bd666afc37b9893368e2e749a81c945c30fce06 /src/gui | |
parent | b49e0184d29c25c99e7001cb1f50cae34423d706 (diff) | |
download | Qt-a43868ca114562502618b4e9c3dd096c65c2e192.zip Qt-a43868ca114562502618b4e9c3dd096c65c2e192.tar.gz Qt-a43868ca114562502618b4e9c3dd096c65c2e192.tar.bz2 |
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
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qmessagebox.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<QObject> receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; QByteArray signalToDisconnectOnClose; @@ -2459,10 +2462,24 @@ void QMessageBox::setInformativeText(const QString &text) #endif label->setWordWrap(true); QGridLayout *grid = static_cast<QGridLayout *>(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(); } |