aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/textmark.h
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-01-09 13:14:39 +0100
committerDavid Schulz <david.schulz@qt.io>2023-01-12 10:19:10 +0000
commitbaa1e3c2e15af93804fa0f8b3158b2422f25b585 (patch)
tree6251a540c1e264478fe6f02ec4518f5c173aad41 /src/plugins/texteditor/textmark.h
parent6415eef6afd9295529be35fbff0bdb66df82e6f6 (diff)
Editor: Allow to hide annotations for a group of text marks
The hiding is not persistent, so on the next Qt Creator start all annotations are visible again. This is meant to quickly get rid of annotations if there are to many irrelevant of a specific kind. Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/texteditor/textmark.h')
-rw-r--r--src/plugins/texteditor/textmark.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/texteditor/textmark.h b/src/plugins/texteditor/textmark.h
index 9bc190ea76..62bb51a1f2 100644
--- a/src/plugins/texteditor/textmark.h
+++ b/src/plugins/texteditor/textmark.h
@@ -28,13 +28,20 @@ namespace TextEditor {
class TextDocument;
+class TextMarkCategory
+{
+public:
+ QString displayName;
+ Utils::Id id;
+};
+
class TEXTEDITOR_EXPORT TextMark
{
Q_DECLARE_TR_FUNCTIONS(TextEditor::TextMark)
public:
TextMark(const Utils::FilePath &fileName,
int lineNumber,
- Utils::Id category);
+ TextMarkCategory category);
TextMark() = delete;
virtual ~TextMark();
@@ -89,7 +96,7 @@ public:
void setPriority(Priority prioriy);
bool isVisible() const;
void setVisible(bool isVisible);
- Utils::Id category() const { return m_category; }
+ TextMarkCategory category() const { return m_category; }
std::optional<Utils::Theme::Color> color() const;
void setColor(const Utils::Theme::Color &color);
@@ -129,7 +136,7 @@ private:
std::function<QIcon()> m_iconProvider;
std::optional<Utils::Theme::Color> m_color;
bool m_visible = false;
- Utils::Id m_category;
+ TextMarkCategory m_category;
QString m_lineAnnotation;
QString m_toolTip;
std::function<QString()> m_toolTipProvider;