4 #include "model/object.h" 6 #include <QAbstractItemModel> 29 QString getName()
const;
30 QString getPath()
const;
39 Qt::ItemFlags getFlags()
const;
53 void setName(
const QString &name);
57 int getChildCount()
const;
58 int getColumnCount()
const;
59 QVariant getData(
int column)
const;
66 QVector<DatabaseItem*> childItems;
69 mutable QImage *icon{};
81 explicit Database(
const QString &path);
89 QVariant data(
const QModelIndex &index,
int role)
const override;
102 bool iterateLeaves(
const QModelIndex &index,
103 std::function<
bool(
const QModelIndex&)> fun);
106 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
107 QModelIndex index(
int row,
int column,
const QModelIndex &parent = {})
const 109 QModelIndex parent(
const QModelIndex &index)
const override;
110 int rowCount(
const QModelIndex &parent = {})
const override;
111 int columnCount(
const QModelIndex &parent = {})
const override;
The abstract base class for all objects in a sheet.
Definition: object.h:21
void setName(const QString &name)
Set the friendly name of the item.
A database of symbols.
Definition: database.h:77
void setPath(QString path)
Set the path of this database item.
DatabaseItem(const QString &path, DatabaseItem *parentItem=nullptr)
Construct a database item.
An item in a Database.
Definition: database.h:12
QImage getIcon() const
Return the icon used to represent the item in the component browser.
An object that consists of other child objects.
Definition: compositeobject.h:16