LibrePCB Developers Documentation
ercmsgdock.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_PROJECT_ERCMSGDOCK_H
21 #define LIBREPCB_PROJECT_ERCMSGDOCK_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <QtCore>
27 #include <QtWidgets>
28 
29 /*******************************************************************************
30  * Namespace / Forward Declarations
31  ******************************************************************************/
32 namespace librepcb {
33 namespace project {
34 
35 class Project;
36 class ErcMsg;
37 class ErcMsgList;
38 
39 namespace editor {
40 
41 namespace Ui {
42 class ErcMsgDock;
43 }
44 
45 /*******************************************************************************
46  * Class ErcMsgDock
47  ******************************************************************************/
48 
52 class ErcMsgDock final : public QDockWidget {
53  Q_OBJECT
54 
55 public:
56  // Constructors / Destructor
57  explicit ErcMsgDock(Project& project);
58  ~ErcMsgDock();
59 
60 public slots:
61 
62  void ercMsgAdded(ErcMsg* ercMsg) noexcept;
63  void ercMsgRemoved(ErcMsg* ercMsg) noexcept;
64  void ercMsgChanged(ErcMsg* ercMsg) noexcept;
65 
66 private slots:
67 
68  // GUI Actions
69  void on_treeWidget_itemSelectionChanged();
70  void on_btnIgnore_clicked(bool checked);
71 
72 private:
73  // Private Methods
74  void updateTopLevelItemTexts() noexcept;
75 
76  // make some methods inaccessible...
77  ErcMsgDock();
78  ErcMsgDock(const ErcMsgDock& other);
79  ErcMsgDock& operator=(const ErcMsgDock& rhs);
80 
81  // General
84  Ui::ErcMsgDock* mUi;
85  QHash<int, QTreeWidgetItem*> mTopLevelItems;
86  QHash<ErcMsg*, QTreeWidgetItem*> mErcMsgItems;
87 };
88 
89 /*******************************************************************************
90  * End of File
91  ******************************************************************************/
92 
93 } // namespace editor
94 } // namespace project
95 } // namespace librepcb
96 
97 #endif // LIBREPCB_PROJECT_ERCMSGDOCK_H
The ErcMsg class represents a message in the ERC (Electrical Rule Check) list.
Definition: ercmsg.h:46
Definition: mainwindow.h:10
The ErcMsgList class contains a list of ERC messages which are visible for the user.
Definition: ercmsglist.h:49
Definition: airwiresbuilder.cpp:32
QHash< int, QTreeWidgetItem * > mTopLevelItems
Definition: ercmsgdock.h:85
The Project class represents a whole (opened) project with all its content.
Definition: project.h:80
Project & mProject
Definition: ercmsgdock.h:82
The ErcMsgDock class.
Definition: ercmsgdock.h:52
ErcMsgList & mErcMsgList
Definition: ercmsgdock.h:83
QHash< ErcMsg *, QTreeWidgetItem * > mErcMsgItems
Definition: ercmsgdock.h:86
Ui::ErcMsgDock * mUi
Definition: ercmsgdock.h:84