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