forked from qt-creator/qt-creator
Clang: Clean up diagnostic widget
* Use a single QLabel - No need for all the QLabels we used. Also, a single QLabel enables selecting and copying all the diagnostics, which is handy when displayed in the info bar. * Avoid call to Utils::ToolTip::hideImmediately() if the location is clicked from the info bar. * Simplify code and API Change-Id: Ib991364e4d6f40ef02dada8ebbb90fe6ff8ae1a1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <utils/icon.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
@@ -84,7 +85,11 @@ void ClangTextMark::setIcon(ClangBackEnd::DiagnosticSeverity severity)
|
||||
|
||||
bool ClangTextMark::addToolTipContent(QLayout *target)
|
||||
{
|
||||
Internal::addToolTipToLayout(m_diagnostic, target, Internal::DisplayHints());
|
||||
using Internal::ClangDiagnosticWidget;
|
||||
|
||||
QWidget *widget = ClangDiagnosticWidget::create({m_diagnostic}, ClangDiagnosticWidget::ToolTip);
|
||||
target->addWidget(widget);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user