forked from qt-creator/qt-creator
QmlDesigner: Implement effect maker nodes popup and load data in it
Change-Id: I95625f2eaf8aac71679b2f816dd20a9167849830 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -40,13 +40,13 @@ QVariant EffectMakerModel::data(const QModelIndex &index, int role) const
|
||||
if (index.row() < 0 || index.row() >= m_categories.count())
|
||||
return {};
|
||||
|
||||
const EffectsCategory *category = m_categories[index.row()];
|
||||
const EffectNodesCategory *category = m_categories.at(index.row());
|
||||
if (role == CategoryRole)
|
||||
return category->name();
|
||||
|
||||
if (role == EffectsRole) {
|
||||
QStringList effectsNames;
|
||||
const QList<EffectNode *> effects = category->effects();
|
||||
const QList<EffectNode *> effects = category->nodes();
|
||||
for (const EffectNode *effect : effects)
|
||||
effectsNames << effect->name();
|
||||
|
||||
@@ -90,7 +90,7 @@ void EffectMakerModel::loadModel()
|
||||
itEffects.next();
|
||||
effects.push_back(new EffectNode(QFileInfo(itEffects.fileName()).baseName()));
|
||||
}
|
||||
EffectsCategory *category = new EffectsCategory(itCategories.fileName(), effects);
|
||||
EffectNodesCategory *category = new EffectNodesCategory(itCategories.fileName(), effects);
|
||||
m_categories.push_back(category);
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user