forked from qt-creator/qt-creator
ClangTools: Add diagnostic mark class
These marks can now be disabled. This greys out the annotation color and the icon of the mark. Change-Id: I5af4591db4baaaef55c986252f77d5d977427b56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "clangtoolsdiagnostic.h"
|
||||
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -47,6 +49,19 @@ bool Diagnostic::isValid() const
|
||||
return !description.isEmpty();
|
||||
}
|
||||
|
||||
QIcon Diagnostic::icon() const
|
||||
{
|
||||
if (type == "warning")
|
||||
return Utils::Icons::CODEMODEL_WARNING.icon();
|
||||
if (type == "error" || type == "fatal")
|
||||
return Utils::Icons::CODEMODEL_ERROR.icon();
|
||||
if (type == "note")
|
||||
return Utils::Icons::INFO.icon();
|
||||
if (type == "fix-it")
|
||||
return Utils::Icons::CODEMODEL_FIXIT.icon();
|
||||
return {};
|
||||
}
|
||||
|
||||
quint32 qHash(const Diagnostic &diagnostic)
|
||||
{
|
||||
return qHash(diagnostic.name)
|
||||
|
||||
Reference in New Issue
Block a user