Modernization + AZStd::function compare fix. (#3680)

* Modernization + small fix.

Modernize ( `bool`/`override`/other) code in AzCore, AzFramework, AzQtComponents, AzToolsFramework, etc.
Replaced a `bind` or two, use `using` in a few places as well.

Fix nullptr comparison of AZStd::function.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Apply review-based changes

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
Artur K
2021-09-02 21:55:09 +02:00
committed by GitHub
parent b3c8b0f5f3
commit 567c0ae24d
150 changed files with 865 additions and 847 deletions
@@ -139,7 +139,7 @@ namespace AzToolsFramework
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities");
for (const auto& entityId : entityIds)
{
AZ::Entity* entity = NULL;
AZ::Entity* entity = nullptr;
EBUS_EVENT_RESULT(entity, AZ::ComponentApplicationBus, FindEntity, entityId);
if (entity)
@@ -1237,7 +1237,7 @@ namespace AzToolsFramework
void ToolsApplication::RequestEditForFile(const char* assetPath, RequestEditResultCallback resultCallback)
{
AZ_Error("RequestEdit", resultCallback != 0, "User result callback is required.");
AZ_Error("RequestEdit", resultCallback != nullptr, "User result callback is required.");
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
if (fileIO && !fileIO->IsReadOnly(assetPath))
@@ -97,7 +97,7 @@ namespace AzToolsFramework::AssetUtils
struct EnabledPlatformsVisitor
: AZ::SettingsRegistryInterface::Visitor
{
void Visit(AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value);
void Visit(AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value) override;
AZStd::vector<AZStd::string> m_enabledPlatforms;
};
@@ -721,7 +721,7 @@ namespace AzToolsFramework
AZ::Data::AssetInfo assetInfo;
AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, assetId);
if (assetInfo.m_assetType == m_inMemoryAsset.GetType()
&& strstr(m_expectedAddedAssetPath.c_str(), assetInfo.m_relativePath.c_str()) != 0)
&& strstr(m_expectedAddedAssetPath.c_str(), assetInfo.m_relativePath.c_str()) != nullptr)
{
m_expectedAddedAssetPath.clear();
m_recentlyAddedAssetPath = assetInfo.m_relativePath;
@@ -103,7 +103,7 @@ namespace AzToolsFramework
newData.clear();
AZ::IO::ByteContainerStream<CacheLineType> ms(&newData);
AZ::SerializeContext* sc = NULL;
AZ::SerializeContext* sc = nullptr;
EBUS_EVENT_RESULT(sc, AZ::ComponentApplicationBus, GetSerializeContext);
AZ_Assert(sc, "Serialization context not found!");
@@ -34,7 +34,7 @@ namespace AzToolsFramework
void SelectionCommand::Post()
{
UndoSystem::UndoStack* undoStack = NULL;
UndoSystem::UndoStack* undoStack = nullptr;
EBUS_EVENT_RESULT(undoStack, AzToolsFramework::ToolsApplicationRequests::Bus, GetUndoStack);
if (undoStack)
@@ -462,7 +462,7 @@ namespace AzToolsFramework
linkId, templateId, templateToDelete.GetFilePath().c_str());
}
result = m_templateToLinkIdsMap.erase(templateToLinkIterator) != 0;
result = m_templateToLinkIdsMap.erase(templateToLinkIterator) != nullptr;
AZ_Assert(result,
"Prefab - PrefabSystemComponent::RemoveTemplate - "
"Failed to remove Template with Id '%llu' on file path '%s' "
@@ -1315,7 +1315,7 @@ namespace AzToolsFramework
void PerforceComponent::ThreadWorker()
{
m_ProcessThreadID = AZStd::this_thread::get_id();
while (1)
while (true)
{
// block until signaled:
m_WorkerSemaphore.acquire();
@@ -38,7 +38,7 @@ namespace AZ
AttributeDynamicScriptValue(const DynamicSerializableField& value)
: m_value(value) {}
virtual ~AttributeDynamicScriptValue()
~AttributeDynamicScriptValue() override
{
m_value.DestroyData();
}
@@ -1031,15 +1031,15 @@ namespace AzToolsFramework
->Attribute("EditButton", "")
->Attribute("EditDescription", "Open in Lua Editor")
->Attribute("EditCallback", &ScriptEditorComponent::LaunchLuaEditor)
->DataElement(0, &ScriptEditorComponent::m_scriptComponent, "Script properties", "The script template")
->DataElement(nullptr, &ScriptEditorComponent::m_scriptComponent, "Script properties", "The script template")
->SetDynamicEditDataProvider(&ScriptEditorComponent::GetScriptPropertyEditData)
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
;
ec->Class<AzFramework::ScriptComponent>("Script Component", "Adding scripting functionality to the entity!")
->DataElement(0, &AzFramework::ScriptComponent::m_properties, "Properties", "Lua script properties")
->DataElement(nullptr, &AzFramework::ScriptComponent::m_properties, "Properties", "Lua script properties")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(0, &AzFramework::ScriptComponent::m_script, "Asset", "")
->DataElement(nullptr, &AzFramework::ScriptComponent::m_script, "Asset", "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::Hide)
->Attribute(AZ::Edit::Attributes::SliceFlags, AZ::Edit::SliceFlags::NotPushable) // Only the editor-component's script asset needs to be slice-pushable.
;
@@ -1048,9 +1048,9 @@ namespace AzToolsFramework
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGroup's class attributes.")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AzFramework::ScriptPropertyGroup::m_name)->
Attribute(AZ::Edit::Attributes::AutoExpand, true)->
DataElement(0, &AzFramework::ScriptPropertyGroup::m_properties, "m_properties", "Properties in this property group")->
DataElement(nullptr, &AzFramework::ScriptPropertyGroup::m_properties, "m_properties", "Properties in this property group")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AzFramework::ScriptPropertyGroup::m_groups, "m_groups", "Subgroups in this property group")->
DataElement(nullptr, &AzFramework::ScriptPropertyGroup::m_groups, "m_groups", "Subgroups in this property group")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly);
ec->Class<AZ::ScriptProperty>("Script Property", "Base class for script properties")->
@@ -1060,50 +1060,50 @@ namespace AzToolsFramework
ec->Class<AZ::ScriptPropertyBoolean>("Script Property (bool)", "A script boolean property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGroup's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyBoolean::m_value, "m_value", "A boolean")->
DataElement(nullptr, &AZ::ScriptPropertyBoolean::m_value, "m_value", "A boolean")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyNumber>("Script Property (number)", "A script number property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGroup's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyNumber::m_value, "m_value", "A number")->
DataElement(nullptr, &AZ::ScriptPropertyNumber::m_value, "m_value", "A number")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyString>("Script Property (string)", "A script string property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGroup's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyString::m_value, "m_value", "A string")->
DataElement(nullptr, &AZ::ScriptPropertyString::m_value, "m_value", "A string")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyGenericClass>("Script Property (object)", "A script object property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGroup's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyGenericClass::m_value, "m_value", "An object")->
DataElement(nullptr, &AZ::ScriptPropertyGenericClass::m_value, "m_value", "An object")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly);
ec->Class<AZ::ScriptPropertyBooleanArray>("Script Property Array(bool)", "A script bool array property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyBooleanArray's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyBooleanArray::m_values, "m_value", "An object")->
DataElement(nullptr, &AZ::ScriptPropertyBooleanArray::m_values, "m_value", "An object")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyNumberArray>("Script Property Array(number)", "A script number array property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyNumberArray's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyNumberArray::m_values, "m_value", "An object")->
DataElement(nullptr, &AZ::ScriptPropertyNumberArray::m_values, "m_value", "An object")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyStringArray>("Script Property Array(string)", "A script string array property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyStringArray's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
DataElement(0, &AZ::ScriptPropertyStringArray::m_values, "m_value", "An object")->
DataElement(nullptr, &AZ::ScriptPropertyStringArray::m_values, "m_value", "An object")->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
ec->Class<AZ::ScriptPropertyGenericClassArray>("Script Property Array(object)", "A script object array property")->
ClassElement(AZ::Edit::ClassElements::EditorData, "ScriptPropertyGenericClassArray's class attributes.")->
Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
Attribute(AZ::Edit::Attributes::DynamicElementType, &AZ::ScriptPropertyGenericClassArray::GetElementTypeUuid)->
DataElement(0, &AZ::ScriptPropertyGenericClassArray::m_values, "m_value", "An object")->
DataElement(nullptr, &AZ::ScriptPropertyGenericClassArray::m_values, "m_value", "An object")->
ElementAttribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)->
Attribute(AZ::Edit::Attributes::NameLabelOverride, &AZ::ScriptProperty::m_name);
@@ -17,21 +17,21 @@ namespace LegacyFramework
{
const char* appName()
{
const char* result = NULL;
const char* result = nullptr;
EBUS_EVENT_RESULT(result, FrameworkApplicationMessages::Bus, GetApplicationName);
return result;
}
const char* appModule()
{
const char* result = NULL;
const char* result = nullptr;
EBUS_EVENT_RESULT(result, FrameworkApplicationMessages::Bus, GetApplicationModule);
return result;
}
const char* appDir()
{
const char* result = NULL;
const char* result = nullptr;
EBUS_EVENT_RESULT(result, FrameworkApplicationMessages::Bus, GetApplicationDirectory);
return result;
}
@@ -74,7 +74,7 @@ namespace LegacyFramework
// helper function which retrieves the serialize context and asserts if its not found.
AZ::SerializeContext* GetSerializeContext()
{
AZ::SerializeContext* serializeContext = NULL;
AZ::SerializeContext* serializeContext = nullptr;
EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext);
AZ_Assert(serializeContext, "No serialize context");
return serializeContext;
@@ -237,7 +237,7 @@ namespace LegacyFramework
{
m_applicationEntity->Deactivate();
delete m_applicationEntity;
m_applicationEntity = NULL;
m_applicationEntity = nullptr;
}
AZ::SystemTickBus::ExecuteQueuedEvents();
@@ -249,7 +249,7 @@ namespace LegacyFramework
#endif
delete m_ptrCommandLineParser;
m_ptrCommandLineParser = NULL;
m_ptrCommandLineParser = nullptr;
CoreMessageBus::Handler::BusDisconnect();
FrameworkApplicationMessages::Handler::BusDisconnect();
@@ -269,7 +269,7 @@ namespace LegacyFramework
{
m_applicationEntity->Deactivate();
delete m_applicationEntity;
m_applicationEntity = NULL;
m_applicationEntity = nullptr;
}
}
@@ -144,9 +144,9 @@ namespace AzToolsFramework
qInstallMessageHandler(myMessageOutput);
}
virtual ~AZQtApplication()
~AZQtApplication() override
{
qInstallMessageHandler(NULL);
qInstallMessageHandler(nullptr);
}
};
@@ -201,9 +201,9 @@ namespace AzToolsFramework
// enable the built-in stylesheet by default:
bool enableStyleSheet = true;
const AzFramework::CommandLine* comp = NULL;
const AzFramework::CommandLine* comp = nullptr;
EBUS_EVENT_RESULT(comp, LegacyFramework::FrameworkApplicationMessages::Bus, GetCommandLineParser);
if (comp != NULL)
if (comp != nullptr)
{
if (comp->HasSwitch("nostyle"))
{
@@ -275,18 +275,18 @@ namespace AzToolsFramework
// see still need to clean up:
m_ptrTicker->cancel();
QApplication::processEvents();
AZ::ComponentApplication* pApp = NULL;
AZ::ComponentApplication* pApp = nullptr;
EBUS_EVENT_RESULT(pApp, AZ::ComponentApplicationBus, GetApplication);
if (pApp)
{
pApp->Tick();
}
azdestroy(m_ptrTicker);
m_ptrTicker = NULL;
m_ptrTicker = nullptr;
}
}
Framework::~Framework(void)
Framework::~Framework()
{
AZ::SystemTickBus::Handler::BusDisconnect();
@@ -299,7 +299,7 @@ namespace AzToolsFramework
delete m_ActionChangeProject;
m_ActionChangeProject = nullptr;
pApplication = NULL;
pApplication = nullptr;
}
// once we set the project, we can then tell all our other windows to restore our state.
@@ -360,7 +360,7 @@ namespace AzToolsFramework
}
m_bTicking = true;
// Tick the component app.
AZ::ComponentApplication* pApp = NULL;
AZ::ComponentApplication* pApp = nullptr;
EBUS_EVENT_RESULT(pApp, AZ::ComponentApplicationBus, GetApplication);
if (pApp)
{
@@ -491,7 +491,7 @@ namespace AzToolsFramework
// we successfully got permission to quit!
// pump the tickbus one last time!
// QApplication::processEvents();
AZ::ComponentApplication* pApp = NULL;
AZ::ComponentApplication* pApp = nullptr;
EBUS_EVENT_RESULT(pApp, AZ::ComponentApplicationBus, GetApplication);
if (pApp)
{
@@ -501,7 +501,7 @@ namespace AzToolsFramework
m_ptrTicker->cancel();
azdestroy(m_ptrTicker);
m_ptrTicker = NULL;
m_ptrTicker = nullptr;
QApplication::quit();
}
@@ -38,7 +38,7 @@ namespace AzToolsFramework
else
{
delete m_View;
m_View = NULL;
m_View = nullptr;
}
}
void Framework::PreferencesAccepted()
@@ -59,11 +59,11 @@ namespace AzToolsFramework
if (m_View)
{
delete m_View;
m_View = NULL;
m_View = nullptr;
}
if (m_Model)
{
m_Model = NULL;
m_Model = nullptr;
}
}
@@ -61,7 +61,7 @@ namespace AzToolsFramework
, m_impl(new BaseLogPanel::Impl)
{
m_impl->storageID = 0;
this->setLayout(aznew LogPanelLayout(NULL));
this->setLayout(aznew LogPanelLayout(nullptr));
m_impl->pTabWidget = new AzQtComponents::TabWidget(this);
m_impl->pTabWidget->setObjectName(QString::fromUtf8("tabWidget"));
@@ -601,7 +601,7 @@ namespace AzToolsFramework
{
if (index >= (int)m_children.size())
{
return NULL;
return nullptr;
}
return m_children[index];
@@ -609,11 +609,11 @@ namespace AzToolsFramework
QLayoutItem* LogPanelLayout::takeAt(int index)
{
QLayoutItem* pItem = NULL;
QLayoutItem* pItem = nullptr;
if (index >= (int)m_children.size())
{
return NULL;
return nullptr;
}
pItem = m_children[index];
@@ -860,7 +860,7 @@ namespace AzToolsFramework
return richLabel;
}
return NULL;
return nullptr;
}
bool LogPanelItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index)
@@ -322,7 +322,7 @@ namespace AzToolsFramework
actionList.removeAll(m_actionSelectAll);
}
QMenu::exec(actionList, QCursor::pos(), 0, this);
QMenu::exec(actionList, QCursor::pos(), nullptr, this);
}
void StyledLogTab::CopySelected()
@@ -236,7 +236,7 @@ namespace AzToolsFramework
AZ_Assert(container, "This node is NOT a container node!");
const AZ::SerializeContext::ClassElement* containerClassElement = container->GetElement(container->GetDefaultElementNameCrc());
AZ_Assert(containerClassElement != NULL, "We should have a valid default element in the container, otherwise we don't know what elements to make!");
AZ_Assert(containerClassElement != nullptr, "We should have a valid default element in the container, otherwise we don't know what elements to make!");
if (!containerClassElement)
{
return false;
@@ -261,7 +261,7 @@ namespace AzToolsFramework
AZ_Assert(newDataAddress, "Faliled to create new element for the continer!");
// cast to base type (if needed)
void* basePtr = m_context->DownCast(newDataAddress, classData->m_typeId, containerClassElement->m_typeId, classData->m_azRtti, containerClassElement->m_azRtti);
AZ_Assert(basePtr != NULL, "Can't cast container element %s to %s, make sure classes are registered in the system and not generics!", classData->m_name, containerClassElement->m_name);
AZ_Assert(basePtr != nullptr, "Can't cast container element %s to %s, make sure classes are registered in the system and not generics!", classData->m_name, containerClassElement->m_name);
*reinterpret_cast<void**>(dataAddress) = basePtr; // store the pointer in the class
/// Store the element in the container
container->StoreElement(GetInstance(i), dataAddress);
@@ -608,7 +608,7 @@ namespace AzToolsFramework
AZ_Assert(sc, "sc can't be NULL!");
AZ_Assert(m_rootInstances.size() > 0, "No root instances have been added to this hierarchy!");
m_curParentNode = NULL;
m_curParentNode = nullptr;
m_isMerging = false;
m_instances.clear();
m_children.clear();
@@ -636,7 +636,7 @@ namespace AzToolsFramework
for (size_t i = 1; i < m_rootInstances.size(); ++i)
{
m_curParentNode = NULL;
m_curParentNode = nullptr;
m_isMerging = true;
m_matched = false;
sc->EnumerateInstanceConst(
@@ -956,7 +956,7 @@ namespace AzToolsFramework
}
}
InstanceDataNode* node = NULL;
InstanceDataNode* node = nullptr;
// Extra steps need to be taken when we are merging
if (m_isMerging)
{
@@ -349,7 +349,7 @@ namespace AzToolsFramework
if (pAssetType)
{
(*pAssetType) = 0;
(*pAssetType) = nullptr;
}
if (!pData)
@@ -529,7 +529,7 @@ namespace AzToolsFramework
if (m_errorButton)
{
// If the button is already active, disconnect its pressed handler so we don't get multiple popups
disconnect(m_errorButton, &QPushButton::pressed, this, 0);
disconnect(m_errorButton, &QPushButton::pressed, this, nullptr);
}
else
{
@@ -137,7 +137,7 @@ namespace AzToolsFramework
Q_UNUSED(debugName)
}
AZ::u32 U32CRCHandler::GetHandlerName(void) const
AZ::u32 U32CRCHandler::GetHandlerName() const
{
return AZ::Edit::UIHandlers::Crc;
}
@@ -225,7 +225,7 @@ namespace AzToolsFramework
if (!pHandlerFound)
{
// does a base class have a handler?
AZ::SerializeContext* sc = NULL;
AZ::SerializeContext* sc = nullptr;
EBUS_EVENT_RESULT(sc, AZ::ComponentApplicationBus, GetSerializeContext);
AZStd::vector<const AZ::SerializeContext::ClassData*> classes;
@@ -254,9 +254,9 @@ namespace AzToolsFramework
void QueueInvalidationIfSharedData(InternalReflectedPropertyEditorEvents* sender, PropertyModificationRefreshLevel level, const AZStd::set<void*>& sourceInstanceSet) override;
// PropertyEditorGUIMessages::Bus::Handler
virtual void RequestWrite(QWidget* editorGUI) override;
virtual void AddElementsToParentContainer(QWidget* editorGUI, size_t numElements, const InstanceDataNode::FillDataClassCallback& fillDataCallback) override;
virtual void RequestRefresh(PropertyModificationRefreshLevel) override;
void RequestWrite(QWidget* editorGUI) override;
void AddElementsToParentContainer(QWidget* editorGUI, size_t numElements, const InstanceDataNode::FillDataClassCallback& fillDataCallback) override;
void RequestRefresh(PropertyModificationRefreshLevel) override;
void RequestPropertyNotify(QWidget* editorGUI) override;
void OnEditingFinished(QWidget* editorGUI) override;
};
@@ -890,7 +890,7 @@ namespace AzToolsFramework
{
instance.Build(m_impl->m_context, AZ::SerializeContext::ENUM_ACCESS_FOR_READ, m_impl->m_dynamicEditDataProvider, m_impl->m_editorParent);
m_impl->FilterNode(instance.GetRootNode(), filter);
m_impl->AddProperty(instance.GetRootNode(), NULL, 0);
m_impl->AddProperty(instance.GetRootNode(), nullptr, 0);
}
m_impl->UpdateExpansionState();
@@ -1077,7 +1077,7 @@ namespace AzToolsFramework
PropertyRowWidget* ReflectedPropertyEditor::Impl::CreateOrPullFromPool()
{
PropertyRowWidget* newWidget = NULL;
PropertyRowWidget* newWidget = nullptr;
if (m_widgetPool.empty())
{
newWidget = aznew PropertyRowWidget(m_containerWidget);
@@ -1184,7 +1184,7 @@ namespace AzToolsFramework
{
// re-create the tab order, based on vertical position in the list.
QWidget* pLastWidget = NULL;
QWidget* pLastWidget = nullptr;
for (AZStd::size_t pos = 0; pos < m_impl->m_widgetsInDisplayOrder.size(); ++pos)
{
@@ -195,17 +195,17 @@ namespace AzToolsFramework
, m_criteriaOperator(FilterOperatorType::Or)
, m_suppressCriteriaChanged(false)
{
m_mainLayout = new QVBoxLayout(NULL);
m_mainLayout = new QVBoxLayout(nullptr);
m_mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
m_mainLayout->setContentsMargins(0, 0, 0, 0);
QHBoxLayout* secondaryLayout = new QHBoxLayout(NULL);
QHBoxLayout* secondaryLayout = new QHBoxLayout(nullptr);
secondaryLayout->setSizeConstraint(QLayout::SetMinimumSize);
secondaryLayout->setContentsMargins(0, 0, 0, 0);
m_filterLayout = new QHBoxLayout(NULL);
m_filterLayout = new QHBoxLayout(nullptr);
m_tagLayout = new FlowLayout(nullptr);
m_tagLayout->setAlignment(Qt::AlignLeft);
QHBoxLayout* filterTextLayout = new QHBoxLayout(NULL);
QHBoxLayout* filterTextLayout = new QHBoxLayout(nullptr);
filterTextLayout->setSizeConstraint(QLayout::SetMinimumSize);
filterTextLayout->setContentsMargins(0, 0, 0, 0);
filterTextLayout->setSpacing(0);
@@ -41,7 +41,7 @@ namespace AzToolsFramework
{
}
virtual ~QTreeViewStateSaverData()
~QTreeViewStateSaverData() override
{
}
@@ -213,7 +213,7 @@ namespace AzToolsFramework
}
}
void ApplySnapshot(QTreeView* treeView)
void ApplySnapshot(QTreeView* treeView) override
{
Q_ASSERT(treeView && treeView->model());
@@ -219,7 +219,7 @@ namespace UnitTest
delete m_application;
}
AZ::Data::AssetInfo GetAssetInfoById(const AZ::Data::AssetId& id)
AZ::Data::AssetInfo GetAssetInfoById(const AZ::Data::AssetId& id) override
{
auto foundIter = m_assetRegistry->m_assetIdToInfo.find(id);
if (foundIter != m_assetRegistry->m_assetIdToInfo.end())
@@ -1202,7 +1202,7 @@ namespace UnitTest
AZ_COMPONENT(HiddenComponent, "{E4D2AD8B-3930-46FC-837A-8DDFCA0FB1AF}", AzToolsFramework::Components::EditorComponentBase);
static Component* s_wasDeleted;
virtual ~HiddenComponent()
~HiddenComponent() override
{
s_wasDeleted = this;
}
@@ -66,7 +66,7 @@ namespace AzToolsFramework
{
}
virtual ~EntitySearch_TestComponent1() override
~EntitySearch_TestComponent1() override
{}
private:
@@ -123,7 +123,7 @@ namespace AzToolsFramework
{
}
virtual ~EntitySearch_TestComponent2() override
~EntitySearch_TestComponent2() override
{}
private:
@@ -55,7 +55,7 @@ namespace UnitTest
AzToolsFramework::EditorRequests::Bus::Handler::BusConnect();
}
~EditorRequestHandlerTest()
~EditorRequestHandlerTest() override
{
AzToolsFramework::EditorRequests::Bus::Handler::BusDisconnect();
}
@@ -67,7 +67,7 @@ namespace UnitTest
services.push_back(AZ_CRC("InspectorTestService1"));
}
virtual ~Inspector_TestComponent1() override
~Inspector_TestComponent1() override
{
}
@@ -136,7 +136,7 @@ namespace UnitTest
services.push_back(AZ_CRC("InspectorTestService2"));
}
virtual ~Inspector_TestComponent2() override
~Inspector_TestComponent2() override
{
}
@@ -205,7 +205,7 @@ namespace UnitTest
services.push_back(AZ_CRC("InspectorTestService3"));
}
virtual ~Inspector_TestComponent3() override
~Inspector_TestComponent3() override
{
}
@@ -31,7 +31,7 @@ namespace UnitTest
class FileFuncTest : public ScopedAllocatorSetupFixture
{
public:
void SetUp()
void SetUp() override
{
m_prevFileIO = AZ::IO::FileIOBase::GetInstance();
AZ::IO::FileIOBase::SetInstance(nullptr);
@@ -104,15 +104,15 @@ namespace UnitTest
if (AZ::EditContext* edit = serializeContext->GetEditContext())
{
edit->Class<TestComponent>("Test Component", "A test component")
->DataElement(0, &TestComponent::m_float, "Float Field", "A float field")
->DataElement(0, &TestComponent::m_string, "String Field", "A string field")
->DataElement(0, &TestComponent::m_normalContainer, "Normal Container", "A container")
->DataElement(0, &TestComponent::m_pointerContainer, "Pointer Container", "A container")
->DataElement(0, &TestComponent::m_subData, "Struct Field", "A sub data type")
->DataElement(nullptr, &TestComponent::m_float, "Float Field", "A float field")
->DataElement(nullptr, &TestComponent::m_string, "String Field", "A string field")
->DataElement(nullptr, &TestComponent::m_normalContainer, "Normal Container", "A container")
->DataElement(nullptr, &TestComponent::m_pointerContainer, "Pointer Container", "A container")
->DataElement(nullptr, &TestComponent::m_subData, "Struct Field", "A sub data type")
;
edit->Class<SubData>("Test Component", "A test component")
->DataElement(0, &SubData::m_int, "Int Field", "An int")
->DataElement(nullptr, &SubData::m_int, "Int Field", "An int")
;
}
}
@@ -156,7 +156,7 @@ namespace UnitTest
{
}
~InstanceDataHierarchyBasicTest()
~InstanceDataHierarchyBasicTest() override
{
}
@@ -481,7 +481,7 @@ namespace UnitTest
{
}
~InstanceDataHierarchyCopyContainerChangesTest()
~InstanceDataHierarchyCopyContainerChangesTest() override
{
}
@@ -680,8 +680,8 @@ namespace UnitTest
;
edit->Class<EnumContainer>("Enum Container", "Test container that has an external enum")
->DataElement(0, &EnumContainer::m_enum, "Enum Field", "An enum value")
->DataElement(0, &EnumContainer::m_enumVector, "Enum Vector Field", "A vector of enum values")
->DataElement(nullptr, &EnumContainer::m_enum, "Enum Field", "An enum value")
->DataElement(nullptr, &EnumContainer::m_enumVector, "Enum Vector Field", "A vector of enum values")
;
}
}
@@ -776,21 +776,21 @@ namespace UnitTest
{
edit->Class<GroupTestComponent>("Group Test Component", "Testing normal groups and toggle groups")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->DataElement(0, &GroupTestComponent::m_float, "Float Field", "A float field")
->DataElement(nullptr, &GroupTestComponent::m_float, "Float Field", "A float field")
->ClassElement(AZ::Edit::ClassElements::Group, "Normal Group")
->DataElement(0, &GroupTestComponent::m_groupFloat, "Float Field", "A float field")
->DataElement(0, &GroupTestComponent::m_subGroupForNormal, "Struct Field", "A sub data type")
->DataElement(nullptr, &GroupTestComponent::m_groupFloat, "Float Field", "A float field")
->DataElement(nullptr, &GroupTestComponent::m_subGroupForNormal, "Struct Field", "A sub data type")
->GroupElementToggle("Group Toggle", &GroupTestComponent::m_groupToggle)
->DataElement(0, &GroupTestComponent::m_toggleGroupInt, "Normal Integer", "An Integer")
->DataElement(0, &GroupTestComponent::m_subGroupForToggle, "Struct Field", "A sub data type")
->DataElement(nullptr, &GroupTestComponent::m_toggleGroupInt, "Normal Integer", "An Integer")
->DataElement(nullptr, &GroupTestComponent::m_subGroupForToggle, "Struct Field", "A sub data type")
;
edit->Class<SubData>("SubGroup Test Component", "Testing nested normal groups and toggle groups")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->ClassElement(AZ::Edit::ClassElements::Group, "Normal SubGroup")
->DataElement(0, &SubData::m_int, "SubGroup Int Field", "An int")
->DataElement(nullptr, &SubData::m_int, "SubGroup Int Field", "An int")
->GroupElementToggle("SubGroup Toggle", &SubData::m_bool)
->DataElement(0, &SubData::m_float, "SubGroup Float Field", "An int")
->DataElement(nullptr, &SubData::m_float, "SubGroup Float Field", "An int")
;
}
}
@@ -974,7 +974,7 @@ namespace UnitTest
{
}
void InsertAndVerifyKeys(AZ::SerializeContext::IDataContainer* container, void* key, void* instance, const AZ::SerializeContext::ClassElement* classElement) const
void InsertAndVerifyKeys(AZ::SerializeContext::IDataContainer* container, void* key, void* instance, const AZ::SerializeContext::ClassElement* classElement) const override
{
T* keyContainer = reinterpret_cast<T*>(key);
for (const T& keyToInsert : keysToInsert)
@@ -1258,7 +1258,7 @@ namespace UnitTest
{
editContext->Class<UIElementContainer>("Test", "")
->UIElement("TestHandler", "UIElement")
->DataElement(0, &UIElementContainer::m_data)
->DataElement(nullptr, &UIElementContainer::m_data)
->UIElement(AZ_CRC("TestHandler2"), "UIElement2")
;
}
@@ -1322,8 +1322,8 @@ namespace UnitTest
{
// By default, DataElements accept multi-edit and UIElements do not
editContext->Class<AggregatedContainer>("Test", "")
->DataElement(0, &AggregatedContainer::m_aggregated)
->DataElement(0, &AggregatedContainer::m_notAggregated)
->DataElement(nullptr, &AggregatedContainer::m_aggregated)
->DataElement(nullptr, &AggregatedContainer::m_notAggregated)
->Attribute(AZ::Edit::Attributes::AcceptsMultiEdit, false)
->UIElement("TestHandler", "aggregatedUIElement")
->Attribute(AZ::Edit::Attributes::AcceptsMultiEdit, true)
@@ -73,7 +73,7 @@ namespace UnitTest
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<TestSimpleAsset>("TestSimpleAsset", "Test data block for a simple asset mock data block")
->DataElement(0, &TestSimpleAsset::m_data, "My Data", "A test bool value.")
->DataElement(nullptr, &TestSimpleAsset::m_data, "My Data", "A test bool value.")
;
}
}
@@ -171,7 +171,7 @@ namespace UnitTest
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::HideChildren)
->DataElement(AZ::Edit::UIHandlers::Default, &PropertyTreeEditorTester::m_myReadOnlyShort, "My Read Only", "A test read only node.")
->Attribute(AZ::Edit::Attributes::ReadOnly, true)
->DataElement(0, &PropertyTreeEditorTester::m_mySubBlock, "My Sub Block", "sub block test")
->DataElement(nullptr, &PropertyTreeEditorTester::m_mySubBlock, "My Sub Block", "sub block test")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->ClassElement(AZ::Edit::ClassElements::Group, "Grouped")
@@ -31,7 +31,7 @@ namespace UnitTest
{
}
~SQLiteTest() = default;
~SQLiteTest() override = default;
void SetUp() override
{
@@ -28,7 +28,7 @@ namespace UnitTest
ScriptContext* m_scriptContext;
~EntityScriptTest()
~EntityScriptTest() override
{
}
@@ -457,7 +457,7 @@ namespace UnitTest
{
AZ::Debug::TraceMessageBus::Handler::BusConnect();
}
~SliceTestWarningInterceptor()
~SliceTestWarningInterceptor() override
{
AZ::Debug::TraceMessageBus::Handler::BusDisconnect();
}
@@ -413,7 +413,7 @@ namespace UnitTest
*m_completedFlag = false;
}
~UndoDestructorTest()
~UndoDestructorTest() override
{
*m_completedFlag = true;
}
@@ -28,7 +28,7 @@ namespace UnitTest
public:
ViewportUiDisplayTestFixture() = default;
void SetUp()
void SetUp() override
{
m_buttonGroup = AZStd::make_shared<ButtonGroup>();
m_buttonGroup->AddButton("");
@@ -36,7 +36,7 @@ namespace UnitTest
m_mockRenderOverlay = new QWidget();
}
void TearDown()
void TearDown() override
{
m_buttonGroup.reset();
delete m_parentWidget;
@@ -26,7 +26,7 @@ namespace UnitTest
{
public:
ViewportUiManagerTestable() = default;
~ViewportUiManagerTestable() = default;
~ViewportUiManagerTestable() override = default;
const AZStd::unordered_map<AzToolsFramework::ViewportUi::ClusterId, AZStd::shared_ptr<ButtonGroup>>& GetClusterMap()
{
@@ -84,12 +84,12 @@ namespace UnitTest
ViewportManagerWrapper m_viewportManagerWrapper;
void SetUp()
void SetUp() override
{
m_viewportManagerWrapper.Create();
}
void TearDown()
void TearDown() override
{
m_viewportManagerWrapper.Destroy();
}