LibrePCB Developers Documentation
librarylisteditorwidget.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_LIBRARY_EDITOR_LIBRARYLISTEDITORWIDGET_H
21 #define LIBREPCB_LIBRARY_EDITOR_LIBRARYLISTEDITORWIDGET_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
27 #include <librepcb/common/uuid.h>
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class SortFilterProxyModel;
38 
39 namespace workspace {
40 class Workspace;
41 }
42 
43 namespace library {
44 namespace editor {
45 
46 namespace Ui {
47 class LibraryListEditorWidget;
48 }
49 
50 /*******************************************************************************
51  * Class LibraryListEditorWidget
52  ******************************************************************************/
53 
57 class LibraryListEditorWidget final : public QWidget {
58  Q_OBJECT
59 
61 
62 public:
63  // Constructors / Destructor
64  LibraryListEditorWidget() = delete;
66  QWidget* parent = nullptr) noexcept;
67  LibraryListEditorWidget(const LibraryListEditorWidget& other) = delete;
68  ~LibraryListEditorWidget() noexcept;
69 
70  // Getters
71  QSet<Uuid> getUuids() const noexcept;
72 
73  // Setters
74  void setUuids(const QSet<Uuid>& uuids) noexcept;
75 
76  // Operator Overloadings
77  LibraryListEditorWidget& operator=(const LibraryListEditorWidget& rhs) =
78  delete;
79 
80 signals:
81  void edited();
82 
83 protected: // Data
84  QScopedPointer<Model> mModel;
85  QScopedPointer<SortFilterProxyModel> mProxyModel;
86  QScopedPointer<Ui::LibraryListEditorWidget> mUi;
87 };
88 
89 /*******************************************************************************
90  * End of File
91  ******************************************************************************/
92 
93 } // namespace editor
94 } // namespace library
95 } // namespace librepcb
96 
97 #endif // LIBREPCB_LIBRARY_EDITOR_LIBRARYLISTEDITORWIDGET_H
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:62
Definition: mainwindow.h:10
Definition: airwiresbuilder.cpp:32
A QSortFilterProxyModel subclass to implement custom sort behavior.
Definition: sortfilterproxymodel.h:45
The LibraryListEditorWidget class.
Definition: librarylisteditorwidget.h:57
A generic QAbstractTableModel subclass to view and edit list of various data types.
Definition: editablelistmodel.h:71
EditableListModel< QList< Uuid > > Model
Definition: librarylisteditorwidget.h:60
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58