setRoleNames is deprecated
Instead implementing roleNames().
This commit is contained in:
parent
c32758c458
commit
cf5ba0378a
2 changed files with 8 additions and 2 deletions
|
@ -47,6 +47,11 @@ namespace Compositing {
|
|||
EffectModel::EffectModel(QObject *parent)
|
||||
: QAbstractItemModel(parent) {
|
||||
|
||||
loadEffects();
|
||||
}
|
||||
|
||||
QHash< int, QByteArray > EffectModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
roleNames[NameRole] = "NameRole";
|
||||
roleNames[DescriptionRole] = "DescriptionRole";
|
||||
|
@ -57,8 +62,7 @@ EffectModel::EffectModel(QObject *parent)
|
|||
roleNames[CategoryRole] = "CategoryRole";
|
||||
roleNames[ServiceNameRole] = "ServiceNameRole";
|
||||
roleNames[EffectStatusRole] = "EffectStatusRole";
|
||||
setRoleNames(roleNames);
|
||||
loadEffects();
|
||||
return roleNames;
|
||||
}
|
||||
|
||||
QModelIndex EffectModel::index(int row, int column, const QModelIndex &parent) const {
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
QString serviceName(const QString &effectName);
|
||||
bool effectListContains(const QString &effectFilter, int source_row);
|
||||
|
||||
virtual QHash< int, QByteArray > roleNames() const override;
|
||||
|
||||
Q_INVOKABLE void effectStatus(const QModelIndex &index, bool effectState);
|
||||
Q_INVOKABLE QString findImage(const QString &imagePath, int size = 128);
|
||||
Q_INVOKABLE void reload();
|
||||
|
|
Loading…
Reference in a new issue