forked from qt-creator/qt-creator
ClangTools: Avoid horizontal scrolling in the diagnostics view
Also, show the diagnostic text in the tooltip because the text might be elided in the view now. Change-Id: I7f38acacf72d68d7e4b696a01c7a0d1a76b4ed98 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -97,6 +97,12 @@ static QString createDiagnosticToolTipString(const Diagnostic &diagnostic)
|
||||
diagnostic.type.toHtmlEscaped());
|
||||
}
|
||||
|
||||
if (!diagnostic.description.isEmpty()) {
|
||||
lines << qMakePair(
|
||||
QCoreApplication::translate("ClangTools::Diagnostic", "Description:"),
|
||||
diagnostic.description.toHtmlEscaped());
|
||||
}
|
||||
|
||||
if (!diagnostic.issueContext.isEmpty() && !diagnostic.issueContextKind.isEmpty()) {
|
||||
lines << qMakePair(
|
||||
QCoreApplication::translate("ClangTools::Diagnostic", "Context:"),
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QHeaderView>
|
||||
|
||||
using namespace Debugger;
|
||||
|
||||
@@ -103,5 +104,12 @@ bool DiagnosticView::eventFilter(QObject *watched, QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void DiagnosticView::setModel(QAbstractItemModel *model)
|
||||
{
|
||||
Debugger::DetailedErrorView::setModel(model);
|
||||
header()->setStretchLastSection(false);
|
||||
header()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
||||
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
|
||||
QList<QAction *> customActions() const;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
void setModel(QAbstractItemModel *model) override;
|
||||
|
||||
QAction *m_suppressAction;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user