itom  4.1.0
breakpointPanel.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet 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 BREAKPOINTPANEL_H
39 #define BREAKPOINTPANEL_H
40 
41 /*
42 Breakpoint panels
43 */
44 
45 #include "../panel.h"
46 #include "../utils/utils.h"
47 #include "../textBlockUserData.h"
48 
49 #include <qevent.h>
50 #include <qsize.h>
51 #include <qcolor.h>
52 #include <qicon.h>
53 #include <qmap.h>
54 
55 class QMenu;
56 class QAction;
57 
58 namespace ito {
59 
60 /*
61 Shows messages collected by one or more checker modes
62 */
63 class BreakpointPanel : public Panel
64 {
65  Q_OBJECT
66 public:
67  BreakpointPanel(const QString &description = "", QWidget *parent = NULL);
68  virtual ~BreakpointPanel();
69 
70  virtual QSize sizeHint() const;
71 
72  void setCurrentLine(int line);
73  void setSelectedCallstackLine(int line);
74  void removeAllLineSelectors();
75 
76 protected:
77  virtual void paintEvent(QPaintEvent *e);
78  virtual void mouseReleaseEvent(QMouseEvent *e);
79  virtual void contextMenuEvent (QContextMenuEvent *e);
80 
81 protected:
82 
83 private:
84  QMap<TextBlockUserData::BreakpointType, QIcon> m_icons;
85  QIcon m_currentLineIcon;
86  int m_currentLine;
87  QIcon m_selectedCallstackLineIcon;
88  int m_selectedCallstackLine;
89 
90  QMenu *m_pContextMenu;
91  QMap<QString, QAction*> m_contextMenuActions;
92  int m_contextMenuLine;
93 
94 signals:
95  void toggleBreakpointRequested(int);
96  void toggleEnableBreakpointRequested(int);
97  void editBreakpointRequested(int);
98  void clearAllBreakpointsRequested();
99  void gotoNextBreakPointRequested();
100  void gotoPreviousBreakRequested();
101 
102 private slots:
103  void menuToggleBreakpoint();
104  void menuToggleEnableBreakpoint();
105  void menuEditBreakpoint();
106  void menuGotoNextBreakPoint();
107  void menuGotoPreviousBreakPoint();
108  void menuClearAllBreakpoints();
109 };
110 
111 } //end namespace ito
112 
113 #endif
114 
115 
Definition: breakpointPanel.h:63
void removeAllLineSelectors()
adds a green arrow if another than the top line of the callstack (during debug) is selected...
Definition: breakpointPanel.cpp:124
Definition: apiFunctionsGraph.cpp:39
virtual void paintEvent(QPaintEvent *e)
this is equal than setCurrentLine(-1); setSelectedCallstackLine(-1);
Definition: breakpointPanel.cpp:154
void setCurrentLine(int line)
line = -1 removes the current line icon
Definition: breakpointPanel.cpp:98
Definition: panel.h:66