summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/Studio/Palettes')
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/IEasyInspectorRowListener.h48
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp2
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp2
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/Qt3DSDMInspectorRow.h2
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/Qt3DSDMMaterialInspectable.cpp135
-rw-r--r--src/Authoring/Studio/Palettes/PaletteManager.cpp1
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Bindings/LayerTimelineItemBinding.cpp1
-rw-r--r--src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp2
8 files changed, 4 insertions, 189 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/IEasyInspectorRowListener.h b/src/Authoring/Studio/Palettes/Inspector/IEasyInspectorRowListener.h
deleted file mode 100644
index ced2099b..00000000
--- a/src/Authoring/Studio/Palettes/Inspector/IEasyInspectorRowListener.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2008 NVIDIA Corporation.
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt 3D Studio.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#pragma once
-#include "ToggleButton.h"
-
-//==============================================================================
-// Namespace
-//==============================================================================
-namespace Q3DStudio {
-
-//==============================================================================
-/**
- * Interface for getting callbacks from the EasyInspectorRow
- */
-class IEasyInspectorRowListener
-{
-public: // IEasyInspectorRowListener
- virtual void OnAnimateToggle(CToggleButton::EButtonState inState) = 0;
- virtual void OnLinkToggle() = 0;
-};
-
-} // namespace Q3DStudio
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp
index 12427b4f..b4c24b22 100644
--- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp
@@ -307,7 +307,7 @@ InspectorControlBase* InspectorControlModel::createMaterialItem(Qt3DSDMInspectab
break;
}
- for (size_t matIdx = 0, end = m_materials.size(); matIdx < end; ++matIdx) {
+ for (int matIdx = 0, end = int(m_materials.size()); matIdx < end; ++matIdx) {
if (m_materials[matIdx].m_relativePath == sourcePath)
item->m_value = values[matIdx + 2]; // +2 for standard and referenced materials
}
diff --git a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
index e839f9f2..51e65e56 100644
--- a/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/ObjectListModel.cpp
@@ -79,7 +79,7 @@ int ObjectListModel::rowCount(const QModelIndex &parent) const
const auto handle = handleForIndex(parent);
const auto children = childrenList(m_slideHandle, handle);
- return children.size();
+ return int(children.size());
}
int ObjectListModel::columnCount(const QModelIndex &parent) const
diff --git a/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMInspectorRow.h b/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMInspectorRow.h
index 5d9a79fd..568d9d81 100644
--- a/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMInspectorRow.h
+++ b/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMInspectorRow.h
@@ -32,8 +32,6 @@
// Includes
//==============================================================================
#include "Qt3DSDMHandles.h"
-#include "IEasyInspectorRowListener.h"
-#include "IDataDrivenChangeListener.h"
#include "DispatchListeners.h"
#include "Qt3DSDMMetaDataTypes.h"
#include "CmdBatch.h"
diff --git a/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMMaterialInspectable.cpp b/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMMaterialInspectable.cpp
index 431bf430..3cfb74c3 100644
--- a/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMMaterialInspectable.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/Qt3DSDMMaterialInspectable.cpp
@@ -32,7 +32,6 @@
#include "Qt3DSDMInspectorRow.h"
#include "Core.h"
#include "IDocumentEditor.h"
-#include "GenericComboDropDown.h"
#include "Qt3DSDMHandles.h"
#include "Doc.h"
#include "GenericFunctor.h"
@@ -47,140 +46,6 @@
using namespace qt3dsdm;
-struct SMaterialTypeDropDown : public CGenericComboDropDown
-{
- struct SMaterialEntry
- {
- Q3DStudio::CString m_Name;
- Q3DStudio::CString m_RelativePath;
- bool operator<(const SMaterialEntry &inOther) const { return m_Name < inOther.m_Name; }
- };
- Qt3DSDMInstanceHandle m_Instance;
- Q3DStudio::CAutoMemPtr<CGenericEditCommitListener> m_CommitListener;
- vector<SMaterialEntry> m_Materials;
- CDoc &m_Doc;
- TSignalConnectionPtr m_FileListPtr;
-
- SMaterialTypeDropDown(CDoc &inDoc, Qt3DSDMInstanceHandle inInstance)
- : m_Instance(inInstance)
- , m_Doc(inDoc)
- {
- using Q3DStudio::CString;
- using Q3DStudio::CFilePath;
- m_CommitListener =
- CREATE_LISTENER(CGenericEditCommitListener, SMaterialTypeDropDown, OnDataCommit);
- AddCommitListener(m_CommitListener);
- m_FileListPtr = m_Doc.GetDirectoryWatchingSystem()->AddDirectory(
- m_Doc.GetDocumentDirectory().toQString(),
- std::bind(&SMaterialTypeDropDown::OnFilesChanged, this, std::placeholders::_1));
- }
-
- vector<SMaterialEntry>::iterator GetMaterialEntry(const Q3DStudio::CString &inRelativePath)
- {
- for (size_t idx = 0, end = m_Materials.size(); idx < end; ++idx)
- if (m_Materials[idx].m_RelativePath == inRelativePath)
- return m_Materials.begin() + idx;
- return m_Materials.end();
- }
-
- vector<SMaterialEntry>::iterator
- GetOrCreateMaterialEntry(const Q3DStudio::CString &inRelativePath)
- {
- vector<SMaterialEntry>::iterator retval = GetMaterialEntry(inRelativePath);
- if (retval == m_Materials.end()) {
- m_Materials.push_back(SMaterialEntry());
- m_Materials.back().m_RelativePath = inRelativePath;
- return m_Materials.begin() + m_Materials.size() - 1;
- } else
- return retval;
- }
-
- void OnFilesChanged(const Q3DStudio::TFileModificationList &inFileModificationList)
- {
- for (size_t idx = 0, end = inFileModificationList.size(); idx < end; ++idx) {
- const Q3DStudio::SFileModificationRecord &theRecord = inFileModificationList[idx];
- Q3DStudio::CFilePath relativePath(Q3DStudio::CFilePath::GetRelativePathFromBase(
- m_Doc.GetDocumentDirectory(), theRecord.m_File));
- Q3DStudio::CString extension = relativePath.GetExtension();
- if (extension.CompareNoCase("material")) {
- switch (theRecord.m_ModificationType) {
- case Q3DStudio::FileModificationType::Created:
- case Q3DStudio::FileModificationType::Modified: {
- SMaterialEntry &theEntry =
- *GetOrCreateMaterialEntry(Q3DStudio::CString(relativePath));
- theEntry.m_Name =
- m_Doc.GetDocumentReader().GetCustomMaterialName(
- theRecord.m_File.toCString());
- } break;
- case Q3DStudio::FileModificationType::Destroyed: {
- vector<SMaterialEntry>::iterator theEntry = GetMaterialEntry(relativePath);
- if (theEntry != m_Materials.end())
- m_Materials.erase(theEntry);
- } break;
-
- default: // don't care.
- break;
- }
- }
- }
-
- std::sort(m_Materials.begin(), m_Materials.end());
-
- RefreshAllItems();
- }
-
- void RefreshAllItems()
- {
- RemoveAllItems();
- AddItem("Standard Material");
- AddItem("Referenced Material");
- CClientDataModelBridge *theBridge = m_Doc.GetStudioSystem()->GetClientDataModelBridge();
- long selectIdx = 0;
- EStudioObjectType theType = theBridge->GetObjectType(m_Instance);
-
- if (theType == OBJTYPE_REFERENCEDMATERIAL)
- selectIdx = 1;
-
- Q3DStudio::CString sourcePath = theBridge->GetSourcePath(m_Instance);
-
- for (size_t matIdx = 0, end = m_Materials.size(); matIdx < end; ++matIdx) {
- AddItem(m_Materials[matIdx].m_Name);
- if (m_Materials[matIdx].m_RelativePath.Compare(sourcePath))
- selectIdx = (long)matIdx + 2;
- }
-
- SelectItem(selectIdx, false);
- }
-
- // Note that the this object is probably deleted when this happens or will be during its
- // execution.
- static void DoChangeObjectType(CDoc *inDoc, const Q3DStudio::CString &inNewType,
- Qt3DSDMInstanceHandle instance)
- {
- using namespace Q3DStudio;
- SCOPED_DOCUMENT_EDITOR(*inDoc, QObject::tr("Set Property"))->SetMaterialType(instance,
- inNewType);
- }
-
- void OnDataCommit()
- {
- using Q3DStudio::CString;
- size_t item = this->GetSelectedItem();
- if (item >= 0) {
- CString selectedType = this->GetItemText(this->GetSelectedItem());
- if (item > 1) {
- size_t matIdx = item - 2;
- if (matIdx < m_Materials.size())
- selectedType = m_Materials[matIdx].m_RelativePath;
- }
- // Fire a command to do this later because we will get screwed if we don't as we will be
- // deleted during this process.
- g_StudioApp.GetCore()->GetDispatch()->FireOnAsynchronousCommand(
- std::bind(&DoChangeObjectType, &m_Doc, selectedType, m_Instance));
- }
- }
-};
-
Qt3DSDMMaterialInspectorGroup::Qt3DSDMMaterialInspectorGroup(
CStudioApp &inApp,
const QString &inName,
diff --git a/src/Authoring/Studio/Palettes/PaletteManager.cpp b/src/Authoring/Studio/Palettes/PaletteManager.cpp
index fbac281d..02ec8324 100644
--- a/src/Authoring/Studio/Palettes/PaletteManager.cpp
+++ b/src/Authoring/Studio/Palettes/PaletteManager.cpp
@@ -120,7 +120,6 @@ CPaletteManager::CPaletteManager(CMainFrame *inMainFrame)
m_timelineWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
WidgetControl *timeLineWidgetControl = new WidgetControl(m_timelineWidget, m_timelineDock);
timeLineWidgetControl->RegisterForDnd(timeLineWidgetControl);
- timeLineWidgetControl->AddMainFlavor(QT3DS_FLAVOR_LISTBOX);
timeLineWidgetControl->AddMainFlavor(QT3DS_FLAVOR_FILE);
timeLineWidgetControl->AddMainFlavor(QT3DS_FLAVOR_ASSET_UICFILE);
timeLineWidgetControl->AddMainFlavor(QT3DS_FLAVOR_ASSET_LIB);
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/LayerTimelineItemBinding.cpp b/src/Authoring/Studio/Palettes/Timeline/Bindings/LayerTimelineItemBinding.cpp
index 0e7b0b19..daa03983 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Bindings/LayerTimelineItemBinding.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/LayerTimelineItemBinding.cpp
@@ -255,4 +255,5 @@ ITimelineItemBinding *CLayerTimelineItemBinding::GetOrCreateBinding(Qt3DSDMInsta
} else
return m_TransMgr->GetOrCreate(instance);
}
+ return nullptr;
}
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
index f1e5c9cc..4704d70b 100644
--- a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
+++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemBinding.cpp
@@ -689,7 +689,7 @@ void Qt3DSDMTimelineItemBinding::getTimeContextIndices(const QSet<int> &children
for (size_t current = 0; current < count; ++current) {
auto handle = graphChildren.GetResult(current);
if (children.contains(handle))
- indexMap.insert(current, int(handle));
+ indexMap.insert(int(current), int(handle));
}
}
}