20 #ifndef __PALETTEMODEL_H__ 21 #define __PALETTEMODEL_H__ 45 PaletteCell(std::unique_ptr<Element> e,
const QString& _name, QString _tag = QString(), qreal _mag = 1.0)
46 : element(std::move(e)), name(_name), tag(_tag),
mag(_mag) {}
65 void paint(QPainter* painter,
const QRect& rect, QIcon::Mode mode, QIcon::State state)
override;
75 std::vector<std::unique_ptr<PaletteCell>>
cells;
78 PaletteModel(QObject* parent =
nullptr) : QAbstractListModel(parent) {}
79 PaletteModel(std::vector<std::unique_ptr<PaletteCell>> c, QObject* parent =
nullptr)
80 : QAbstractListModel(parent), cells(std::move(c)) {}
82 void insert(
int idx,
Element* e,
const QString& name, QString tag = QString(), qreal
mag = 1.0);
83 void append(
Element* e,
const QString& name, QString tag = QString(), qreal
mag = 1.0);
85 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
86 QVariant data(
const QModelIndex& index,
int role)
const override;
89 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
91 QMimeData*
mimeData(
const QModelIndexList& indexes)
const override;
92 QStringList mimeTypes()
const override;
94 static constexpr
int paletteElementRole = Qt::UserRole;
const PaletteCell * _cell
Definition: palettemodel_list.h:56
double y
Definition: palettemodel_list.h:38
qreal mag
Definition: palettemodel_list.h:41
PaletteModel(std::vector< std::unique_ptr< PaletteCell >> c, QObject *parent=nullptr)
Definition: palettemodel_list.h:79
QString name
Definition: palettemodel_list.h:33
Base class of score layout elements.
Definition: element.h:158
double x
Definition: palettemodel_list.h:37
std::vector< std::unique_ptr< PaletteCell > > cells
Definition: palettemodel_list.h:75
QString tag
Definition: palettemodel_list.h:34
std::unique_ptr< Element > element
Definition: palettemodel_list.h:32
Definition: palettemodel_list.h:72
bool drawStaff
Definition: palettemodel_list.h:36
PaletteCell(std::unique_ptr< Element > e, const QString &_name, QString _tag=QString(), qreal _mag=1.0)
Definition: palettemodel_list.h:45
PaletteCellIconEngine(const PaletteCell *cell)
Definition: palettemodel_list.h:59
Definition: palettemodel_list.h:31
double yoffset
Definition: palettemodel_list.h:40
double xoffset
Definition: palettemodel_list.h:39
Definition: palettemodel_list.h:55
Definition: aeolus.cpp:26
bool readOnly
Definition: palettemodel_list.h:42
QIconEngine * clone() const override
Definition: palettemodel_list.h:61
QByteArray mimeData() const
Definition: palettetree.cpp:350
PaletteModel(QObject *parent=nullptr)
Definition: palettemodel_list.h:78