summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-02-22 10:26:16 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2019-02-22 08:56:38 +0000
commitc9d077037e44d49180b53bfdd32bd1e669725567 (patch)
tree04e1063b08fc5f4b8dfbb62c3899365a423ba0d6
parent05ec6f079013b7000288f43e4f219bce5ec2952b (diff)
Refresh variants model after edits
Task-number: QT3DS-3091 Change-Id: I8fb23bf9c0508ceed98a1d0917005e070ea76531 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h2
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp5
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/VariantsGroupModel.cpp8
3 files changed, 12 insertions, 3 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h
index 23205050..5e7b92c2 100644
--- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h
+++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h
@@ -171,7 +171,7 @@ private:
}
};
- mutable QVector<GroupInspectorControl> m_groupElements;
+ QVector<GroupInspectorControl> m_groupElements;
CInspectableBase *m_inspectableBase = nullptr;
SGuideInspectableImpl *m_guideInspectable = nullptr;
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp
index 38e4d6f9..be8cdbcf 100644
--- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp
@@ -474,6 +474,7 @@ void InspectorControlView::showTagContextMenu(int x, int y, const QString &group
if (dlg.exec() == QDialog::Accepted) {
g_StudioApp.GetCore()->getProjectFile().renameVariantTag(group, dlg.getNames().first,
dlg.getNames().second);
+ m_variantsGroupModel->refresh();
}
});
@@ -482,6 +483,7 @@ void InspectorControlView::showTagContextMenu(int x, int y, const QString &group
g_StudioApp.GetCore()->getProjectFile().deleteVariantTag(group, tag);
g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants();
g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants();
+ m_variantsGroupModel->refresh();
});
theContextMenu.exec(mapToGlobal({x, y}));
@@ -500,6 +502,7 @@ void InspectorControlView::showGroupContextMenu(int x, int y, const QString &gro
if (dlg.exec() == QDialog::Accepted) {
projectFile.renameVariantGroup(dlg.getNames().first, dlg.getNames().second);
g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants();
+ m_variantsGroupModel->refresh();
}
});
@@ -511,6 +514,7 @@ void InspectorControlView::showGroupContextMenu(int x, int y, const QString &gro
// no need to refresh variants in the timeline widget as it references the group color in
// the project file m_variants, and a redraw is triggered upon color selection dialog close.
g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants();
+ m_variantsGroupModel->refresh();
});
auto actionDelete = theContextMenu.addAction(QObject::tr("Delete Group"));
@@ -518,6 +522,7 @@ void InspectorControlView::showGroupContextMenu(int x, int y, const QString &gro
projectFile.deleteVariantGroup(group);
g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants();
g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants();
+ m_variantsGroupModel->refresh();
});
theContextMenu.exec(mapToGlobal({x, y}));
diff --git a/src/Authoring/Studio/Palettes/Inspector/VariantsGroupModel.cpp b/src/Authoring/Studio/Palettes/Inspector/VariantsGroupModel.cpp
index 36464ae3..a122889b 100644
--- a/src/Authoring/Studio/Palettes/Inspector/VariantsGroupModel.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/VariantsGroupModel.cpp
@@ -158,8 +158,10 @@ void VariantsGroupModel::addNewTag(const QString &group)
{
VariantTagDialog dlg(VariantTagDialog::AddTag, group);
- if (dlg.exec() == QDialog::Accepted)
+ if (dlg.exec() == QDialog::Accepted) {
g_StudioApp.GetCore()->getProjectFile().addVariantTag(group, dlg.getNames().second);
+ refresh();
+ }
}
void VariantsGroupModel::importVariants()
@@ -211,8 +213,10 @@ void VariantsGroupModel::addNewGroup()
{
VariantTagDialog dlg(VariantTagDialog::AddGroup);
- if (dlg.exec() == QDialog::Accepted)
+ if (dlg.exec() == QDialog::Accepted) {
g_StudioApp.GetCore()->getProjectFile().addVariantGroup(dlg.getNames().second);
+ refresh();
+ }
}
QHash<int, QByteArray> VariantsGroupModel::roleNames() const