forked from qt-creator/qt-creator
Axivion: Prepare ui for displaying issues
UI preparation which may change when adding the functionality of retrieving respective information from the dashboard. Change-Id: I9ec8069d780f925b00ba63982af6b410ddec9a5a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -55,6 +55,20 @@ using namespace Utils;
|
||||
|
||||
namespace Axivion::Internal {
|
||||
|
||||
QIcon iconForIssue(const QString &prefix)
|
||||
{
|
||||
static QHash<QString, QIcon> prefixToIcon;
|
||||
auto it = prefixToIcon.find(prefix);
|
||||
|
||||
if (it == prefixToIcon.end()) {
|
||||
Icon icon({{FilePath::fromString(":/axivion/images/button-" + prefix.toLower() + ".png"),
|
||||
Theme::PaletteButtonText}},
|
||||
Icon::Tint);
|
||||
it = prefixToIcon.insert(prefix, icon.icon());
|
||||
}
|
||||
return it.value();
|
||||
}
|
||||
|
||||
class AxivionPluginPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
@@ -94,6 +108,7 @@ AxivionTextMark::AxivionTextMark(const FilePath &filePath, const ShortIssue &iss
|
||||
const QString markText = issue.entity.isEmpty() ? issue.message
|
||||
: issue.entity + ": " + issue.message;
|
||||
setToolTip(issue.errorNumber + " " + markText);
|
||||
setIcon(iconForIssue("SV")); // FIXME adapt to the issue
|
||||
setPriority(TextEditor::TextMark::NormalPriority);
|
||||
setLineAnnotation(markText);
|
||||
setActionsProvider([this]{
|
||||
|
||||
Reference in New Issue
Block a user