forked from qt-creator/qt-creator
Clang: Make diagnostic display adapt to size of the info bar
Change-Id: Ibc7431234b8a68c8e2b0c3f25387de96b203c4c5 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -112,10 +112,16 @@ private:
|
|||||||
label->setTextFormat(Qt::RichText);
|
label->setTextFormat(Qt::RichText);
|
||||||
label->setText(text);
|
label->setText(text);
|
||||||
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
// Using "setWordWrap(true)" alone will wrap the text already for small
|
|
||||||
// widths, so do not require word wrapping until we hit limits.
|
if (m_displayHints.limitWidth) {
|
||||||
if (m_displayHints.limitWidth && label->sizeHint().width() > widthLimit()) {
|
const int limit = widthLimit();
|
||||||
label->setMaximumWidth(widthLimit());
|
// Using "setWordWrap(true)" alone will wrap the text already for small
|
||||||
|
// widths, so do not require word wrapping until we hit limits.
|
||||||
|
if (label->sizeHint().width() > limit) {
|
||||||
|
label->setMaximumWidth(limit);
|
||||||
|
label->setWordWrap(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
label->setWordWrap(true);
|
label->setWordWrap(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +147,7 @@ private:
|
|||||||
QString htmlText(const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics)
|
QString htmlText(const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics)
|
||||||
{
|
{
|
||||||
// For debugging, add: style='border-width:1px;border-color:black'
|
// For debugging, add: style='border-width:1px;border-color:black'
|
||||||
QString text = "<table cellspacing='0' cellpadding='0'>";
|
QString text = "<table cellspacing='0' cellpadding='0' width='100%'>";
|
||||||
|
|
||||||
foreach (const ClangBackEnd::DiagnosticContainer &diagnostic, diagnostics)
|
foreach (const ClangBackEnd::DiagnosticContainer &diagnostic, diagnostics)
|
||||||
text.append(tableRows(diagnostic));
|
text.append(tableRows(diagnostic));
|
||||||
|
|||||||
Reference in New Issue
Block a user