itom
Loading...
Searching...
No Matches
checkerBookmarkPanel.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21
22 Further hints:
23 ------------------------
24
25 This file belongs to the code editor of itom. The code editor is
26 in major parts a fork / rewritten version of the python-based source
27 code editor PyQode from Colin Duquesnoy and others
28 (see https://github.com/pyQode). PyQode itself is licensed under
29 the MIT License (MIT).
30
31 Some parts of the code editor of itom are also inspired by the
32 source code editor of the Spyder IDE (https://github.com/spyder-ide),
33 also licensed under the MIT License and developed by the Spyder Project
34 Contributors.
35
36*********************************************************************** */
37
38#ifndef CHECKERBOOKMARKPANEL_H
39#define CHECKERBOOKMARKPANEL_H
40
41/*
42Checker panels:
43
44- CheckerPanel: draw checker messages in front of each line
45- GlobalCheckerPanel: draw all checker markers as colored rectangle to
46 offer a global view of all errors
47*/
48
49#include "../panel.h"
50#include "../utils/utils.h"
51#include "../textBlockUserData.h"
52#include "../../models/bookmarkModel.h"
53
54#include <qevent.h>
55#include <qsize.h>
56#include <qcolor.h>
57#include <qicon.h>
58#include <qmap.h>
59
60class QMenu;
61class QAction;
62
63namespace ito {
64
65class DelayJobRunnerBase;
66/*
67Shows messages collected by one or more checker modes
68*/
70{
71 Q_OBJECT
72public:
73 CheckerBookmarkPanel(BookmarkModel *bookmarkModel, const QString &description = "", QWidget *parent = NULL);
74 virtual ~CheckerBookmarkPanel();
75
76 virtual QSize sizeHint() const;
77
78 virtual void onUninstall();
79
80 QList<CodeCheckerItem> markersForLine(int line) const;
81
82 static QIcon iconFromMessages(bool hasCheckerMessages, bool hasBookmark, CodeCheckerItem::CheckerType checkerStatus);
83
84protected:
85 virtual void paintEvent(QPaintEvent *e);
86 virtual void mouseReleaseEvent(QMouseEvent *e);
87 virtual void mouseMoveEvent(QMouseEvent *e);
88 virtual void leaveEvent(QEvent *e);
89 virtual void contextMenuEvent (QContextMenuEvent *e);
90
91protected:
92 void displayTooltip(QList<QVariant> args);
93
94private:
95 int m_previousLine;
96 DelayJobRunnerBase *m_pJobRunner;
97 QMenu *m_pContextMenu;
98 QMap<QString, QAction*> m_contextMenuActions;
99 int m_contextMenuLine;
100 BookmarkModel* m_pBookmarkModel;
101
102signals:
104 void gotoBookmarkRequested(bool next);
105 void clearAllBookmarksRequested();
106
107private slots:
108 void menuToggleBookmark();
109};
110
111} //end namespace ito
112
113#endif
model for management of all bookmarks. This model will be displayed by a viewer-widget in the main wi...
Definition bookmarkModel.h:65
Definition checkerBookmarkPanel.h:70
void toggleBookmarkRequested(int line)
borrowed reference to the bookmark model. This model is owned by the script editor organizer.
Definition delayJobRunner.h:55
Definition panel.h:67
Definition apiFunctionsGraph.cpp:40