15#include <QAbstractListModel>
24#include "../drivers/btconstmoduleset.h"
66 static std::shared_ptr<BtBookshelfModel>
newInstance();
75 int rowCount(QModelIndex const & parent = QModelIndex()) const override;
77 QVariant
data(QModelIndex const & index,
int role) const override;
79 Qt::Orientation orientation,
80 int role = Qt::DisplayRole) const override;
81 bool setData(QModelIndex const & index,
82 QVariant const & value,
101 void clear(
bool destroy =
false);
115 bool destroy =
false);
124 bool destroy =
false);
132 void removeModules(QList<CSwordModuleInfo *>
const & modules,
133 bool destroy =
false);
bool setData(QModelIndex const &index, QVariant const &value, int role=ModuleHiddenRole) override
static std::shared_ptr< BtBookshelfModel > newInstance()
void removeModule(CSwordModuleInfo *const module, bool destroy=false)
void addModule(CSwordModuleInfo *const module)
void moduleIndexed(bool indexed)
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
~BtBookshelfModel() noexcept override
CSwordModuleInfo * getModule(QString const &name) const
CSwordModuleInfo * module(QModelIndex const &index) const
QList< CSwordModuleInfo * > m_data
QVariant data(CSwordModuleInfo *module, int role) const
BtBookshelfModel(BtBookshelfModel const &)=delete
void moduleHidden(bool hidden)
void moduleUnlocked(bool unlocked)
void moduleDataChanged(CSwordModuleInfo *module)
BtBookshelfModel(BtBookshelfModel &&)=delete
void removeModules(BtConstModuleSet const &modules, bool destroy=false)
QList< CSwordModuleInfo * > const & moduleList() const
void clear(bool destroy=false)
int rowCount(QModelIndex const &parent=QModelIndex()) const override
Used to restrict construction to newInstance() only.