20#ifndef LIBREPCB_EDITOR_CATEGORYTREEMODELLEGACY_H
21#define LIBREPCB_EDITOR_CATEGORYTREEMODELLEGACY_H
37class WorkspaceLibraryDb;
54 QVector<std::shared_ptr<Item>>
childs;
73 Q_DECLARE_FLAGS(Filters,
Filter)
79 const QStringList& localeOrder,
80 Filters filters) noexcept;
88 const QModelIndex&
parent = QModelIndex()) const noexcept override;
90 const QModelIndex&
parent = QModelIndex()) const noexcept override;
93 const QModelIndex&
parent = QModelIndex()) const noexcept override;
94 QModelIndex
parent(const QModelIndex&
index) const noexcept override;
95 QVariant
headerData(
int section, Qt::Orientation orientation,
96 int role = Qt::DisplayRole) const noexcept override;
98 int role = Qt::DisplayRole) const noexcept override;
112 std::shared_ptr<
Item> parentItem,
113 const QVector<
std::shared_ptr<
Item>>& newChilds) noexcept;
127Q_DECLARE_OPERATORS_FOR_FLAGS(
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The WorkspaceLibraryDb class.
Definition workspacelibrarydb.h:58
The CategoryTreeModelLegacy class.
Definition categorytreemodellegacy.h:48
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const noexcept override
Definition categorytreemodellegacy.cpp:105
void updateModelItem(std::shared_ptr< Item > parentItem, const QVector< std::shared_ptr< Item > > &newChilds) noexcept
Definition categorytreemodellegacy.cpp:246
QVector< std::shared_ptr< Item > > getChilds(std::shared_ptr< Item > parent) const noexcept
Definition categorytreemodellegacy.cpp:169
bool listPackageCategories() const noexcept
Definition categorytreemodellegacy.cpp:241
std::shared_ptr< Item > mRootItem
Definition categorytreemodellegacy.h:121
QModelIndex parent(const QModelIndex &index) const noexcept override
Definition categorytreemodellegacy.cpp:96
Item * itemFromIndex(const QModelIndex &index) const noexcept
Definition categorytreemodellegacy.cpp:290
QModelIndex indexFromItem(const Item *item) const noexcept
Definition categorytreemodellegacy.cpp:305
bool listAll() const noexcept
Definition categorytreemodellegacy.cpp:237
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const noexcept override
Definition categorytreemodellegacy.cpp:86
bool containsItems(const std::optional< Uuid > &uuid) const
Definition categorytreemodellegacy.cpp:213
int columnCount(const QModelIndex &parent=QModelIndex()) const noexcept override
Definition categorytreemodellegacy.cpp:74
int rowCount(const QModelIndex &parent=QModelIndex()) const noexcept override
Definition categorytreemodellegacy.cpp:80
const Filters mFilters
Definition categorytreemodellegacy.h:120
void update() noexcept
Definition categorytreemodellegacy.cpp:140
Filter
Definition categorytreemodellegacy.h:59
@ CmpCat
Show all component categories, even empty ones.
@ CmpCatWithDevices
Show component categories containing devices.
@ PkgCatWithPackages
Show package categories containing packages.
@ CmpCatWithSymbols
Show component categories containing symbols.
@ PkgCat
Show all package categories, even empty ones.
@ CmpCatWithComponents
Show component categories containing components.
QStringList mLocaleOrder
Definition categorytreemodellegacy.h:119
void setLocaleOrder(const QStringList &order) noexcept
Definition categorytreemodellegacy.cpp:62
const WorkspaceLibraryDb & mLibrary
Definition categorytreemodellegacy.h:118
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const noexcept override
Definition categorytreemodellegacy.cpp:119
Definition occmodel.cpp:77
Definition categorytreemodellegacy.h:49
QString text
Definition categorytreemodellegacy.h:52
std::optional< Uuid > uuid
std::nullopt for items without category
Definition categorytreemodellegacy.h:51
QString tooltip
Definition categorytreemodellegacy.h:53
QVector< std::shared_ptr< Item > > childs
Definition categorytreemodellegacy.h:54
std::weak_ptr< Item > parent
nullptr for root categories
Definition categorytreemodellegacy.h:50