diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2019-01-29 09:20:21 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2019-01-31 05:17:12 +0000 |
commit | 8e0f95b4dcf98042900b2351dfdd5edf7053195d (patch) | |
tree | 1faf6777a2d860f2a9460d15ce5603f016e2aa0f /src/Authoring/Studio/Palettes/Inspector | |
parent | 410cd933be319f0f79e63aac368636e0988291c3 (diff) |
Disable toggling eyeball on master slide
Task-number: QT3DS-2924
Change-Id: I497fa2357018403a4b946adb54ad76a96c706aa5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Inspector')
3 files changed, 15 insertions, 0 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp index 79e76f3b..69543a12 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp @@ -57,6 +57,7 @@ #include "ProjectFile.h" #include "MaterialRefView.h" #include "BasicObjectsModel.h" +#include "Qt3DSDMSlides.h" #include <QtCore/qtimer.h> #include <QtQml/qqmlcontext.h> @@ -293,6 +294,8 @@ bool InspectorControlView::canLinkProperty(int instance, int handle) const && (type & (OBJTYPE_CUSTOMMATERIAL | OBJTYPE_MATERIAL | OBJTYPE_REFERENCEDMATERIAL))) { return false; } + if (doc->GetStudioSystem()->GetPropertySystem()->GetName(handle) == L"eyeball") + return false; return doc->GetDocumentReader().CanPropertyBeLinked(instance, handle); } @@ -377,6 +380,16 @@ QString InspectorControlView::titleIcon() const return {}; } +bool InspectorControlView::isEditable(int handle) const +{ + CDoc *doc = g_StudioApp.GetCore()->GetDoc(); + if (doc->GetStudioSystem()->GetSlideSystem()->IsMasterSlide(doc->GetActiveSlide()) + && doc->GetStudioSystem()->GetPropertySystem()->GetName(handle) == L"eyeball") { + return false; + } + return true; +} + void InspectorControlView::OnSelectionSet(Q3DStudio::SSelectedValue inSelectable) { updateInspectable(g_StudioApp.GetInspectableFromSelectable(inSelectable)); diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h index 6cb7fd21..98d67f41 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.h @@ -84,6 +84,7 @@ public: Q_INVOKABLE QString convertPathToProjectRoot(const QString &presentationPath); Q_INVOKABLE bool isRefMaterial(int instance) const; Q_INVOKABLE QString noneString() const; + Q_INVOKABLE bool isEditable(int handle) const; // IDataModelListener void OnBeginDataModelNotifications() override; diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml index 3677bc0e..9a9c0c01 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml @@ -237,6 +237,7 @@ Rectangle { RowLayout { id: groupDelegateItem spacing: 0 + enabled: _parentView.isEditable(modelData.handle) property alias loadedItem: loader.item |