LibrePCB Developers Documentation
packagemodellisteditorwidget.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_PACKAGEMODELLISTEDITORWIDGET_H
21#define LIBREPCB_EDITOR_PACKAGEMODELLISTEDITORWIDGET_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Footprint;
39class Package;
40
41namespace editor {
42
43class EditableTableWidget;
44class PackageModelListModel;
45class SortFilterProxyModel;
46class UndoStack;
47
48/*******************************************************************************
49 * Class PackageModelListEditorWidget
50 ******************************************************************************/
51
55class PackageModelListEditorWidget final : public QWidget {
56 Q_OBJECT
57
58public:
59 // Constructors / Destructor
60 explicit PackageModelListEditorWidget(QWidget* parent = nullptr) noexcept;
62 delete;
64
65 // Setters
66 void setFrameStyle(int style) noexcept;
67 void setReadOnly(bool readOnly) noexcept;
68 void setReferences(Package* package, UndoStack* stack) noexcept;
69 void setCurrentFootprint(std::shared_ptr<Footprint> footprint) noexcept;
70
71 // Operator Overloadings
73 const PackageModelListEditorWidget& rhs) = delete;
74
75signals:
76 void currentIndexChanged(int index);
77
78private:
82 QScopedPointer<EditableTableWidget> mView;
83};
84
85/*******************************************************************************
86 * End of File
87 ******************************************************************************/
88
89} // namespace editor
90} // namespace librepcb
91
92#endif
The Footprint class represents one footprint variant of a package.
Definition: footprint.h:55
The Package class represents a package of a component (including footprint and 3D model)
Definition: package.h:59
A QTableView subclass which adds buttons to edit the underlying model.
Definition: editabletablewidget.h:42
The PackageModelListEditorWidget class.
Definition: packagemodellisteditorwidget.h:55
void setReferences(Package *package, UndoStack *stack) noexcept
Definition: packagemodellisteditorwidget.cpp:100
~PackageModelListEditorWidget() noexcept
Definition: packagemodellisteditorwidget.cpp:85
void setReadOnly(bool readOnly) noexcept
Definition: packagemodellisteditorwidget.cpp:96
QScopedPointer< EditableTableWidget > mView
Definition: packagemodellisteditorwidget.h:82
void setCurrentFootprint(std::shared_ptr< Footprint > footprint) noexcept
Definition: packagemodellisteditorwidget.cpp:107
PackageModelListEditorWidget(const PackageModelListEditorWidget &other)=delete
QPointer< Package > mCurrentPackage
Definition: packagemodellisteditorwidget.h:79
PackageModelListEditorWidget(QWidget *parent=nullptr) noexcept
Definition: packagemodellisteditorwidget.cpp:44
void setFrameStyle(int style) noexcept
Definition: packagemodellisteditorwidget.cpp:92
QScopedPointer< SortFilterProxyModel > mProxy
Definition: packagemodellisteditorwidget.h:81
QScopedPointer< PackageModelListModel > mModel
Definition: packagemodellisteditorwidget.h:80
The PackageModelListModel class.
Definition: packagemodellistmodel.h:52
A QSortFilterProxyModel subclass to implement custom sort behavior.
Definition: sortfilterproxymodel.h:46
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77