diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-04-04 15:59:47 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-04-05 12:59:03 +0000 |
commit | 0c0c438384343148ac74dfe14e16a814d02936e4 (patch) | |
tree | 4b189a66fce0bf9c2f61a0939ffd65651b2a634d /src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp | |
parent | c627989061ecb728765eb427b0d17307d4abcc65 (diff) |
Implement variants support for Models
Also some relevant tweaks here and there. Next: supporting variants on Groups, then Components.
Task-number: QT3DS-3234
Change-Id: I3943baef1118cecbcd4211b6eefca3d54b21a89e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp')
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp index ddcec94c..0c04ba55 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp @@ -60,8 +60,6 @@ #include "Qt3DSDMSlides.h" #include "VariantsGroupModel.h" #include "VariantTagDialog.h" -#include "Views.h" -#include "MainFrm.h" #include "SlideView.h" #include "TimelineWidget.h" @@ -466,18 +464,18 @@ void InspectorControlView::showTagContextMenu(int x, int y, const QString &group // refresh slide view so the tooltip show the renamed tag immediately, no need to // refresh the timeline because each row gets the tags directly from the property which // is always up to date. - g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants(); + g_StudioApp.m_pMainWnd->getSlideView()->refreshVariants(); } }); auto actionDelete = theContextMenu.addAction(QObject::tr("Delete Tag")); connect(actionDelete, &QAction::triggered, this, [&]() { g_StudioApp.GetCore()->getProjectFile().deleteVariantTag(group, tag); - g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants(); - g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants(); + g_StudioApp.m_pMainWnd->getTimelineWidget()->refreshVariants(); + g_StudioApp.m_pMainWnd->getSlideView()->refreshVariants(); m_variantsGroupModel->refresh(); if (g_StudioApp.GetCore()->getProjectFile().variantsDef()[group].m_tags.size() == 0) - g_StudioApp.GetViews()->getMainFrame()->updateActionFilterEnableState(); + g_StudioApp.m_pMainWnd->updateActionFilterEnableState(); }); theContextMenu.exec(mapToGlobal({x, y})); @@ -495,33 +493,33 @@ void InspectorControlView::showGroupContextMenu(int x, int y, const QString &gro VariantTagDialog dlg(VariantTagDialog::RenameGroup, {}, group); if (dlg.exec() == QDialog::Accepted) { projectFile.renameVariantGroup(dlg.getNames().first, dlg.getNames().second); - g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants(); + g_StudioApp.m_pMainWnd->getTimelineWidget()->refreshVariants(); m_variantsGroupModel->refresh(); // refresh slide view so the tooltip show the renamed group immediately, no need to // refresh the timeline because each row gets the tags directly from the property which // is always up to date. - g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants(); + g_StudioApp.m_pMainWnd->getSlideView()->refreshVariants(); } }); auto actionColor = theContextMenu.addAction(QObject::tr("Change Group Color")); connect(actionColor, &QAction::triggered, this, [&]() { - const auto variantsDef = g_StudioApp.GetCore()->getProjectFile().variantsDef(); + const auto variantsDef = projectFile.variantsDef(); QColor newColor = this->showColorDialog(variantsDef[group].m_color); projectFile.changeVariantGroupColor(group, newColor.name()); // 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(); + g_StudioApp.m_pMainWnd->getSlideView()->refreshVariants(); m_variantsGroupModel->refresh(); }); auto actionDelete = theContextMenu.addAction(QObject::tr("Delete Group")); connect(actionDelete, &QAction::triggered, this, [&]() { projectFile.deleteVariantGroup(group); - g_StudioApp.GetViews()->getMainFrame()->getTimelineWidget()->refreshVariants(); - g_StudioApp.GetViews()->getMainFrame()->getSlideView()->refreshVariants(); - g_StudioApp.GetViews()->getMainFrame()->updateActionFilterEnableState(); + g_StudioApp.m_pMainWnd->getTimelineWidget()->refreshVariants(); + g_StudioApp.m_pMainWnd->getSlideView()->refreshVariants(); + g_StudioApp.m_pMainWnd->updateActionFilterEnableState(); m_variantsGroupModel->refresh(); }); |