mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
Editor: Convert QVector over to QList
In Qt 6 QVector is now a typedef alias for QList, so we can convert these over to make the semantics explicit.
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include <Core/GameProject/CGameProject.h>
|
#include <Core/GameProject/CGameProject.h>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QList>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVector>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
class CBasicViewport;
|
class CBasicViewport;
|
||||||
@@ -24,7 +24,7 @@ class CEditorApplication : public QApplication
|
|||||||
CWorldEditor *mpWorldEditor = nullptr;
|
CWorldEditor *mpWorldEditor = nullptr;
|
||||||
CResourceBrowser *mpResourceBrowser = nullptr;
|
CResourceBrowser *mpResourceBrowser = nullptr;
|
||||||
CProjectSettingsDialog *mpProjectDialog = nullptr;
|
CProjectSettingsDialog *mpProjectDialog = nullptr;
|
||||||
QVector<IEditor*> mEditorWindows;
|
QList<IEditor*> mEditorWindows;
|
||||||
QMap<CResourceEntry*,IEditor*> mEditingMap;
|
QMap<CResourceEntry*,IEditor*> mEditingMap;
|
||||||
bool mInitialized = false;
|
bool mInitialized = false;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
CWorldEditor *mpEditor;
|
CWorldEditor *mpEditor;
|
||||||
CAssetID mAreaID;
|
CAssetID mAreaID;
|
||||||
QVector<SCopiedNode> mCopiedNodes;
|
QList<SCopiedNode> mCopiedNodes;
|
||||||
EGame mGame;
|
EGame mGame;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
|
|
||||||
CAssetID AreaID() const { return mAreaID; }
|
CAssetID AreaID() const { return mAreaID; }
|
||||||
EGame Game() const { return mGame; }
|
EGame Game() const { return mGame; }
|
||||||
const QVector<SCopiedNode>& CopiedNodes() const { return mCopiedNodes; }
|
const QList<SCopiedNode>& CopiedNodes() const { return mCopiedNodes; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CNODECOPYMIMEDATA
|
#endif // CNODECOPYMIMEDATA
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <Core/GameProject/CGameProject.h>
|
#include <Core/GameProject/CGameProject.h>
|
||||||
#include <Core/Resource/CWorld.h>
|
#include <Core/Resource/CWorld.h>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -18,8 +19,8 @@ class CProjectSettingsDialog : public QDialog
|
|||||||
std::unique_ptr<Ui::CProjectSettingsDialog> mpUI;
|
std::unique_ptr<Ui::CProjectSettingsDialog> mpUI;
|
||||||
CGameProject *mpProject = nullptr;
|
CGameProject *mpProject = nullptr;
|
||||||
|
|
||||||
QVector<CResourceEntry*> mWorldEntries;
|
QList<CResourceEntry*> mWorldEntries;
|
||||||
QVector<CResourceEntry*> mAreaEntries;
|
QList<CResourceEntry*> mAreaEntries;
|
||||||
TResPtr<CWorld> mpWorld;
|
TResPtr<CWorld> mpWorld;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "Editor/IEditor.h"
|
#include "Editor/IEditor.h"
|
||||||
#include "Tweaks/CTweakData.h"
|
#include "Tweaks/CTweakData.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@@ -18,7 +19,7 @@ class CTweakEditor : public IEditor
|
|||||||
std::unique_ptr<Ui::CTweakEditor> mpUI;
|
std::unique_ptr<Ui::CTweakEditor> mpUI;
|
||||||
|
|
||||||
/** List of editable tweak assets */
|
/** List of editable tweak assets */
|
||||||
QVector<CTweakData*> mTweakAssets;
|
QList<CTweakData*> mTweakAssets;
|
||||||
|
|
||||||
/** Whether the editor window has been shown before */
|
/** Whether the editor window has been shown before */
|
||||||
bool mHasBeenShown = false;
|
bool mHasBeenShown = false;
|
||||||
|
|||||||
@@ -368,12 +368,12 @@ void CPropertyDelegate::setModelData(QWidget *pEditor, QAbstractItemModel* /*pMo
|
|||||||
|
|
||||||
if (!pObject)
|
if (!pObject)
|
||||||
{
|
{
|
||||||
const QVector<void*> DataPointers{pData};
|
const QList<void*> DataPointers{pData};
|
||||||
pCommand = new CEditIntrinsicPropertyCommand(pProp, DataPointers, mpModel, rkIndex);
|
pCommand = new CEditIntrinsicPropertyCommand(pProp, DataPointers, mpModel, rkIndex);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const QVector<CScriptObject*> Objects{pObject};
|
const QList<CScriptObject*> Objects{pObject};
|
||||||
pCommand = (Type != EPropertyType::Array) ?
|
pCommand = (Type != EPropertyType::Array) ?
|
||||||
new CEditScriptPropertyCommand(pProp, Objects, mpModel, rkIndex) :
|
new CEditScriptPropertyCommand(pProp, Objects, mpModel, rkIndex) :
|
||||||
new CResizeScriptArrayCommand (pProp, Objects, mpModel, rkIndex);
|
new CResizeScriptArrayCommand (pProp, Objects, mpModel, rkIndex);
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ void CPropertyModel::SetShowPropertyNameValidity(bool Enable)
|
|||||||
mShowNameValidity = Enable;
|
mShowNameValidity = Enable;
|
||||||
|
|
||||||
// Emit data changed so that name colors are updated;
|
// Emit data changed so that name colors are updated;
|
||||||
const QVector<int> Roles{static_cast<int>(Qt::ForegroundRole)};
|
const QList<int> Roles{static_cast<int>(Qt::ForegroundRole)};
|
||||||
const QModelIndex TopLeft = index(0, 0, QModelIndex());
|
const QModelIndex TopLeft = index(0, 0, QModelIndex());
|
||||||
const QModelIndex BottomRight = index(rowCount(QModelIndex()) - 1, 0, QModelIndex());
|
const QModelIndex BottomRight = index(rowCount(QModelIndex()) - 1, 0, QModelIndex());
|
||||||
emit dataChanged(TopLeft, BottomRight, Roles);
|
emit dataChanged(TopLeft, BottomRight, Roles);
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
#include <Core/Resource/Script/Property/Properties.h>
|
#include <Core/Resource/Script/Property/Properties.h>
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
#include <QList>
|
||||||
|
#include <QMap>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class CPropertyModel : public QAbstractItemModel
|
class CPropertyModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
@@ -16,7 +19,7 @@ class CPropertyModel : public QAbstractItemModel
|
|||||||
int ParentID;
|
int ParentID;
|
||||||
std::vector<int> ChildIDs;
|
std::vector<int> ChildIDs;
|
||||||
};
|
};
|
||||||
QVector<SProperty> mProperties;
|
QList<SProperty> mProperties;
|
||||||
QMap<IProperty*, int> mPropertyToIDMap;
|
QMap<IProperty*, int> mPropertyToIDMap;
|
||||||
int mFirstUnusedID = -1;
|
int mFirstUnusedID = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -665,7 +665,7 @@ bool CResourceBrowser::CreateDirectory()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CResourceBrowser::Delete(QVector<CResourceEntry*> Resources, QVector<CVirtualDirectory*> Directories)
|
bool CResourceBrowser::Delete(QList<CResourceEntry*> Resources, QList<CVirtualDirectory*> Directories)
|
||||||
{
|
{
|
||||||
// Don't delete any resources/directories that are still referenced.
|
// Don't delete any resources/directories that are still referenced.
|
||||||
// This is kind of a hack but there's no good way to clear out these references right now.
|
// This is kind of a hack but there's no good way to clear out these references right now.
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class CResourceBrowser;
|
class CResourceBrowser;
|
||||||
}
|
}
|
||||||
@@ -97,7 +99,7 @@ public slots:
|
|||||||
void OnSortModeChanged(int Index);
|
void OnSortModeChanged(int Index);
|
||||||
void OnCreateAssetAction();
|
void OnCreateAssetAction();
|
||||||
bool CreateDirectory();
|
bool CreateDirectory();
|
||||||
bool Delete(QVector<CResourceEntry*> Resources, QVector<CVirtualDirectory*> Directories);
|
bool Delete(QList<CResourceEntry*> Resources, QList<CVirtualDirectory*> Directories);
|
||||||
void OnSearchStringChanged(const QString& SearchString);
|
void OnSearchStringChanged(const QString& SearchString);
|
||||||
void OnDirectorySelectionChanged(const QModelIndex& rkNewIndex);
|
void OnDirectorySelectionChanged(const QModelIndex& rkNewIndex);
|
||||||
void OnDoubleClickTable(QModelIndex Index);
|
void OnDoubleClickTable(QModelIndex Index);
|
||||||
|
|||||||
@@ -211,8 +211,8 @@ void CResourceTableContextMenu::ShowDependencies()
|
|||||||
void CResourceTableContextMenu::Delete()
|
void CResourceTableContextMenu::Delete()
|
||||||
{
|
{
|
||||||
// Create confirmation message
|
// Create confirmation message
|
||||||
QVector<CResourceEntry*> Resources;
|
QList<CResourceEntry*> Resources;
|
||||||
QVector<CVirtualDirectory*> Directories;
|
QList<CVirtualDirectory*> Directories;
|
||||||
|
|
||||||
for (const QModelIndex& kIndex : mSelectedIndexes)
|
for (const QModelIndex& kIndex : mSelectedIndexes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ void CResourceTableView::DeleteSelected()
|
|||||||
// Figure out which indices can actually be deleted
|
// Figure out which indices can actually be deleted
|
||||||
CResourceProxyModel *pProxy = static_cast<CResourceProxyModel*>(model());
|
CResourceProxyModel *pProxy = static_cast<CResourceProxyModel*>(model());
|
||||||
CResourceTableModel *pModel = static_cast<CResourceTableModel*>(pProxy->sourceModel());
|
CResourceTableModel *pModel = static_cast<CResourceTableModel*>(pProxy->sourceModel());
|
||||||
QVector<CResourceEntry*> ResourcesToDelete;
|
QList<CResourceEntry*> ResourcesToDelete;
|
||||||
QVector<CVirtualDirectory*> DirsToDelete;
|
QList<CVirtualDirectory*> DirsToDelete;
|
||||||
|
|
||||||
for (const QModelIndex Index : List)
|
for (const QModelIndex& Index : List)
|
||||||
{
|
{
|
||||||
const QModelIndex SourceIndex = pProxy->mapToSource(Index);
|
const QModelIndex SourceIndex = pProxy->mapToSource(Index);
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ QModelIndex CVirtualDirectoryModel::GetIndexForDirectory(const CVirtualDirectory
|
|||||||
if (pDir == nullptr)
|
if (pDir == nullptr)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
QVector<int> Indices;
|
QList<int> Indices;
|
||||||
const CVirtualDirectory* pOriginal = pDir;
|
const CVirtualDirectory* pOriginal = pDir;
|
||||||
const CVirtualDirectory* pParent = pDir->Parent();
|
const CVirtualDirectory* pParent = pDir->Parent();
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ void CStringListModel::SetPreviewLanguage(ELanguage InLanguage)
|
|||||||
if (NumStrings == 0)
|
if (NumStrings == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QVector<int> Roles{Qt::UserRole};
|
const QList<int> Roles{Qt::UserRole};
|
||||||
emit dataChanged(index(0), index(NumStrings - 1), Roles);
|
emit dataChanged(index(0), index(NumStrings - 1), Roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "CDeleteLinksCommand.h"
|
#include "CDeleteLinksCommand.h"
|
||||||
#include <Core/Resource/Script/CLink.h>
|
#include <Core/Resource/Script/CLink.h>
|
||||||
|
|
||||||
CDeleteLinksCommand::CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QVector<uint32>& rkIndices)
|
CDeleteLinksCommand::CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QList<uint32>& rkIndices)
|
||||||
: IUndoCommand("Delete Links")
|
: IUndoCommand("Delete Links")
|
||||||
, mpEditor(pEditor)
|
, mpEditor(pEditor)
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ void CDeleteLinksCommand::undo()
|
|||||||
SDeletedLink *pDelLink;
|
SDeletedLink *pDelLink;
|
||||||
CLink *pLink;
|
CLink *pLink;
|
||||||
};
|
};
|
||||||
QVector<SNewLink> NewLinks;
|
QList<SNewLink> NewLinks;
|
||||||
|
|
||||||
for (SDeletedLink& rDelLink : mLinks)
|
for (SDeletedLink& rDelLink : mLinks)
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ void CDeleteLinksCommand::undo()
|
|||||||
|
|
||||||
void CDeleteLinksCommand::redo()
|
void CDeleteLinksCommand::redo()
|
||||||
{
|
{
|
||||||
QVector<CLink*> Links;
|
QList<CLink*> Links;
|
||||||
|
|
||||||
for (const auto& rLink : mLinks)
|
for (const auto& rLink : mLinks)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ class CDeleteLinksCommand : public IUndoCommand
|
|||||||
uint32 SenderIndex;
|
uint32 SenderIndex;
|
||||||
uint32 ReceiverIndex;
|
uint32 ReceiverIndex;
|
||||||
};
|
};
|
||||||
QVector<SDeletedLink> mLinks;
|
QList<SDeletedLink> mLinks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CDeleteLinksCommand() = default;
|
CDeleteLinksCommand() = default;
|
||||||
CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QVector<uint32>& rkIndices);
|
CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QList<uint32>& rkIndices);
|
||||||
void undo() override;
|
void undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
bool AffectsCleanState() const override { return true; }
|
bool AffectsCleanState() const override { return true; }
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class CDeleteSelectionCommand : public IUndoCommand
|
|||||||
uint32 LayerIndex;
|
uint32 LayerIndex;
|
||||||
std::vector<char> InstanceData;
|
std::vector<char> InstanceData;
|
||||||
};
|
};
|
||||||
QVector<SDeletedNode> mDeletedNodes;
|
QList<SDeletedNode> mDeletedNodes;
|
||||||
|
|
||||||
struct SDeletedLink
|
struct SDeletedLink
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ class CDeleteSelectionCommand : public IUndoCommand
|
|||||||
CInstancePtr pSender;
|
CInstancePtr pSender;
|
||||||
CInstancePtr pReceiver;
|
CInstancePtr pReceiver;
|
||||||
};
|
};
|
||||||
QVector<SDeletedLink> mDeletedLinks;
|
QList<SDeletedLink> mDeletedLinks;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = "Delete");
|
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = "Delete");
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
class CEditIntrinsicPropertyCommand : public IEditPropertyCommand
|
class CEditIntrinsicPropertyCommand : public IEditPropertyCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
QVector<void*> mDataPointers;
|
QList<void*> mDataPointers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CEditIntrinsicPropertyCommand(IProperty* pProperty,
|
CEditIntrinsicPropertyCommand(IProperty* pProperty,
|
||||||
const QVector<void*>& kDataPointers,
|
const QList<void*>& kDataPointers,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& kCommandName = "Edit Property")
|
const QString& kCommandName = "Edit Property")
|
||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetObjectDataPointers(QVector<void*>& rOutPointers) const override
|
void GetObjectDataPointers(QList<void*>& rOutPointers) const override
|
||||||
{
|
{
|
||||||
rOutPointers = mDataPointers;
|
rOutPointers = mDataPointers;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
class CEditScriptPropertyCommand : public IEditPropertyCommand
|
class CEditScriptPropertyCommand : public IEditPropertyCommand
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
QVector<CInstancePtr> mInstances;
|
QList<CInstancePtr> mInstances;
|
||||||
QModelIndex mIndex;
|
QModelIndex mIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CEditScriptPropertyCommand(IProperty* pProperty,
|
CEditScriptPropertyCommand(IProperty* pProperty,
|
||||||
const QVector<CScriptObject*>& kInstances,
|
const QList<CScriptObject*>& kInstances,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& kCommandName = "Edit Property")
|
const QString& kCommandName = "Edit Property")
|
||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
mInstances.push_back(CInstancePtr(instance));
|
mInstances.push_back(CInstancePtr(instance));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetObjectDataPointers(QVector<void*>& OutPointers) const override
|
void GetObjectDataPointers(QList<void*>& OutPointers) const override
|
||||||
{
|
{
|
||||||
// todo: support multiple objects being edited at once on the property view
|
// todo: support multiple objects being edited at once on the property view
|
||||||
if (mIndex.isValid())
|
if (mIndex.isValid())
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void CPasteNodesCommand::redo()
|
|||||||
if (!mpMimeData)
|
if (!mpMimeData)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QVector<CNodeCopyMimeData::SCopiedNode>& rkNodes = mpMimeData->CopiedNodes();
|
const auto& rkNodes = mpMimeData->CopiedNodes();
|
||||||
CScene *pScene = mpEditor->Scene();
|
CScene *pScene = mpEditor->Scene();
|
||||||
CGameArea *pArea = mpEditor->ActiveArea();
|
CGameArea *pArea = mpEditor->ActiveArea();
|
||||||
QList<CSceneNode*> PastedNodes;
|
QList<CSceneNode*> PastedNodes;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class CResizeScriptArrayCommand : public CEditScriptPropertyCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CResizeScriptArrayCommand(IProperty* pProperty,
|
CResizeScriptArrayCommand(IProperty* pProperty,
|
||||||
const QVector<CScriptObject*>& rkInstances,
|
const QList<CScriptObject*>& rkInstances,
|
||||||
CPropertyModel* pModel,
|
CPropertyModel* pModel,
|
||||||
QModelIndex Index = QModelIndex(),
|
QModelIndex Index = QModelIndex(),
|
||||||
const QString& rkCommandName = "Resize Array"
|
const QString& rkCommandName = "Resize Array"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ void IEditPropertyCommand::SaveObjectStateToArray(std::vector<char>& rVector)
|
|||||||
CVectorOutStream MemStream(&rVector, EEndian::SystemEndian);
|
CVectorOutStream MemStream(&rVector, EEndian::SystemEndian);
|
||||||
CBasicBinaryWriter Writer(&MemStream, CSerialVersion(IArchive::skCurrentArchiveVersion, 0, mpProperty->Game()));
|
CBasicBinaryWriter Writer(&MemStream, CSerialVersion(IArchive::skCurrentArchiveVersion, 0, mpProperty->Game()));
|
||||||
|
|
||||||
QVector<void*> DataPointers;
|
QList<void*> DataPointers;
|
||||||
GetObjectDataPointers(DataPointers);
|
GetObjectDataPointers(DataPointers);
|
||||||
|
|
||||||
for (void* pData : DataPointers)
|
for (void* pData : DataPointers)
|
||||||
@@ -22,7 +22,7 @@ void IEditPropertyCommand::RestoreObjectStateFromArray(std::vector<char>& rArray
|
|||||||
{
|
{
|
||||||
CBasicBinaryReader Reader(rArray.data(), rArray.size(), CSerialVersion(IArchive::skCurrentArchiveVersion, 0, mpProperty->Game()));
|
CBasicBinaryReader Reader(rArray.data(), rArray.size(), CSerialVersion(IArchive::skCurrentArchiveVersion, 0, mpProperty->Game()));
|
||||||
|
|
||||||
QVector<void*> DataPointers;
|
QList<void*> DataPointers;
|
||||||
GetObjectDataPointers(DataPointers);
|
GetObjectDataPointers(DataPointers);
|
||||||
|
|
||||||
for (void* pData : DataPointers)
|
for (void* pData : DataPointers)
|
||||||
@@ -100,10 +100,10 @@ bool IEditPropertyCommand::mergeWith(const QUndoCommand *pkOther)
|
|||||||
|
|
||||||
if (pkCmd && pkCmd->mpProperty == mpProperty)
|
if (pkCmd && pkCmd->mpProperty == mpProperty)
|
||||||
{
|
{
|
||||||
QVector<void*> MyPointers;
|
QList<void*> MyPointers;
|
||||||
GetObjectDataPointers(MyPointers);
|
GetObjectDataPointers(MyPointers);
|
||||||
|
|
||||||
QVector<void*> TheirPointers;
|
QList<void*> TheirPointers;
|
||||||
pkCmd->GetObjectDataPointers(TheirPointers);
|
pkCmd->GetObjectDataPointers(TheirPointers);
|
||||||
|
|
||||||
if (TheirPointers.size() == MyPointers.size())
|
if (TheirPointers.size() == MyPointers.size())
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
void SetEditComplete(bool IsComplete);
|
void SetEditComplete(bool IsComplete);
|
||||||
|
|
||||||
/** Interface */
|
/** Interface */
|
||||||
virtual void GetObjectDataPointers(QVector<void*>& rOutPointers) const = 0;
|
virtual void GetObjectDataPointers(QList<void*>& rOutPointers) const = 0;
|
||||||
|
|
||||||
/** IUndoCommand/QUndoCommand interface */
|
/** IUndoCommand/QUndoCommand interface */
|
||||||
int id() const override;
|
int id() const override;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
class CFilteredResourceModel : public QAbstractTableModel
|
class CFilteredResourceModel : public QAbstractTableModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QVector<CResourceEntry*> mEntries;
|
QList<CResourceEntry*> mEntries;
|
||||||
int mInitialRow = 0;
|
int mInitialRow = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
template<typename EnumT>
|
template<typename EnumT>
|
||||||
class TEnumComboBox : public QComboBox
|
class TEnumComboBox : public QComboBox
|
||||||
{
|
{
|
||||||
/** Vector forming an index -> enum mapping */
|
/** List forming an index -> enum mapping */
|
||||||
QVector<EnumT> mValueList;
|
QList<EnumT> mValueList;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
#include <Core/Scene/CModelNode.h>
|
#include <Core/Scene/CModelNode.h>
|
||||||
#include <Core/Scene/CScriptNode.h>
|
#include <Core/Scene/CScriptNode.h>
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QVector>
|
#include <QList>
|
||||||
|
#include <QMap>
|
||||||
|
|
||||||
class CWorldEditor;
|
class CWorldEditor;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CTemplateEditDialog : public QDialog
|
|||||||
bool mOriginalNameWasValid = true;
|
bool mOriginalNameWasValid = true;
|
||||||
|
|
||||||
// These members help track what templates need to be updated and resaved after the user clicks OK
|
// These members help track what templates need to be updated and resaved after the user clicks OK
|
||||||
QVector<IProperty*> mEquivalentProperties;
|
QList<IProperty*> mEquivalentProperties;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CTemplateEditDialog(IProperty* pProperty, QWidget *pParent = nullptr);
|
explicit CTemplateEditDialog(IProperty* pProperty, QWidget *pParent = nullptr);
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ void CWorldEditor::OnPropertyModified(IProperty *pProp)
|
|||||||
void CWorldEditor::SetSelectionActive(bool Active)
|
void CWorldEditor::SetSelectionActive(bool Active)
|
||||||
{
|
{
|
||||||
// Gather list of selected objects that actually have Active properties
|
// Gather list of selected objects that actually have Active properties
|
||||||
QVector<CScriptObject*> Objects;
|
QList<CScriptObject*> Objects;
|
||||||
|
|
||||||
for (CSelectionIterator It(mpSelection); It; ++It)
|
for (CSelectionIterator It(mpSelection); It; ++It)
|
||||||
{
|
{
|
||||||
@@ -640,7 +640,7 @@ void CWorldEditor::SetSelectionActive(bool Active)
|
|||||||
|
|
||||||
while (!Objects.isEmpty())
|
while (!Objects.isEmpty())
|
||||||
{
|
{
|
||||||
QVector<CScriptObject*> CommandObjects;
|
QList<CScriptObject*> CommandObjects;
|
||||||
CScriptTemplate* pTemplate = Objects[0]->Template();
|
CScriptTemplate* pTemplate = Objects[0]->Template();
|
||||||
CBoolProperty* pActiveProperty = pTemplate->ActiveProperty();
|
CBoolProperty* pActiveProperty = pTemplate->ActiveProperty();
|
||||||
|
|
||||||
@@ -1123,7 +1123,7 @@ void CWorldEditor::OnUnlinkClicked()
|
|||||||
|
|
||||||
if (UnlinkIncoming)
|
if (UnlinkIncoming)
|
||||||
{
|
{
|
||||||
QVector<uint32> LinkIndices;
|
QList<uint32> LinkIndices;
|
||||||
for (uint32 iLink = 0; iLink < pInst->NumLinks(ELinkType::Incoming); iLink++)
|
for (uint32 iLink = 0; iLink < pInst->NumLinks(ELinkType::Incoming); iLink++)
|
||||||
LinkIndices.push_back(iLink);
|
LinkIndices.push_back(iLink);
|
||||||
|
|
||||||
@@ -1133,7 +1133,7 @@ void CWorldEditor::OnUnlinkClicked()
|
|||||||
|
|
||||||
if (UnlinkOutgoing)
|
if (UnlinkOutgoing)
|
||||||
{
|
{
|
||||||
QVector<uint32> LinkIndices;
|
QList<uint32> LinkIndices;
|
||||||
for (uint32 iLink = 0; iLink < pInst->NumLinks(ELinkType::Outgoing); iLink++)
|
for (uint32 iLink = 0; iLink < pInst->NumLinks(ELinkType::Outgoing); iLink++)
|
||||||
LinkIndices.push_back(iLink);
|
LinkIndices.push_back(iLink);
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ void WModifyTab::OnDeleteLinksClicked()
|
|||||||
if (SelectedIndices.isEmpty())
|
if (SelectedIndices.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QVector<uint32> Indices;
|
QList<uint32> Indices;
|
||||||
Indices.reserve(SelectedIndices.size());
|
Indices.reserve(SelectedIndices.size());
|
||||||
for (const auto& index : SelectedIndices)
|
for (const auto& index : SelectedIndices)
|
||||||
Indices.push_back(index.row());
|
Indices.push_back(index.row());
|
||||||
|
|||||||
Reference in New Issue
Block a user