From c27b41776136b7d0ddd225041d3c49cfaf03bff7 Mon Sep 17 00:00:00 2001 From: Yuriy Toporovskyy Date: Thu, 24 Jun 2021 10:15:06 -0400 Subject: [PATCH] Address pr feedback - Use AZ warning macros instead of #pragma warning - std::numeric_limits->AZStd::numeric_limits - IsClose->IsCloseMag - AZ_Warning->AZ_Assert --- .../AzQtComponents/Components/Widgets/VectorInput.cpp | 5 +++-- .../AzQtComponents/Components/Widgets/VectorInput.h | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp index d7e6cb85cd..84ec0a2d33 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -66,7 +67,7 @@ const QString& VectorElement::label() const void VectorElement::setValue(double newValue) { // Nothing to do if the value is not actually changed - if (AZ::IsClose(m_value, newValue, std::numeric_limits::epsilon())) + if (AZ::IsCloseMag(m_value, newValue, AZStd::numeric_limits::epsilon())) { return; } @@ -97,7 +98,7 @@ void VectorElement::onSpinBoxEditingFinished() if (m_value == deferredValue.prevValue) { - AZ_Warning("VectorElement", !m_spinBox->hasFocus(), "Editing finished but the spinbox still has focus"); + AZ_Assert(!m_spinBox->hasFocus(), "Editing finished but the spinbox still has focus"); setValue(deferredValue.value); } } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.h index a9cd743830..1c015eb584 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/VectorInput.h @@ -24,11 +24,9 @@ namespace AzQtComponents class Style; - #pragma warning(push) - // 'AzQtComponents::VectorElement::m_deferredExternalValue': class 'AZStd::optional' needs to // have dll-interface to be used by clients of class 'AzQtComponents::VectorElement' - #pragma warning(disable:4251) + AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING /*! * \class VectorElement @@ -115,7 +113,8 @@ namespace AzQtComponents private: struct DeferredSetValue { - double prevValue, value; + double prevValue; + double value; }; // m_labelText must be initialised before m_spinBox. It is used by editFieldRect, which gets @@ -132,7 +131,7 @@ namespace AzQtComponents AZStd::optional m_deferredExternalValue; }; - #pragma warning(pop) + AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING //////////////////////////////////////////////////////////////////////////