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:
@@ -147,7 +147,7 @@ namespace AzQtComponents
|
||||
TabBar::tabLayoutChange();
|
||||
|
||||
// Only the active tab's close button should be shown
|
||||
const ButtonPosition closeSide = (ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, this);
|
||||
const ButtonPosition closeSide = (ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, nullptr, this);
|
||||
const int numTabs = count();
|
||||
const int activeTabIndex = currentIndex();
|
||||
for (int i = 0; i < numTabs; ++i)
|
||||
@@ -190,7 +190,7 @@ namespace AzQtComponents
|
||||
}
|
||||
});
|
||||
|
||||
const ButtonPosition closeSide = (ButtonPosition) style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, this);
|
||||
const ButtonPosition closeSide = (ButtonPosition) style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, nullptr, this);
|
||||
setTabButton(index, closeSide, closeButton);
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ QLayoutItem* FlowLayout::takeAt(int index)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const
|
||||
else if (parent->isWidgetType())
|
||||
{
|
||||
QWidget* pw = static_cast<QWidget*>(parent);
|
||||
return pw->style()->pixelMetric(pm, 0, pw);
|
||||
return pw->style()->pixelMetric(pm, nullptr, pw);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -75,11 +75,11 @@ namespace AzQtComponents
|
||||
connect(slider, &QSlider::sliderReleased, this, [this] { m_dragging = false; });
|
||||
}
|
||||
}
|
||||
~ClickEventFilterPrivate() {}
|
||||
~ClickEventFilterPrivate() override {}
|
||||
signals:
|
||||
void clickOnApplication(const QPoint& pos);
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* event)
|
||||
bool eventFilter(QObject* obj, QEvent* event) override
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease && !m_dragging)
|
||||
{
|
||||
|
||||
@@ -773,7 +773,7 @@ namespace AzQtComponents
|
||||
if (numButtons > 0)
|
||||
{
|
||||
// and finally add the right margins QLineEdit removes to make the buttons fit (it thinks)
|
||||
const int iconSize = style->pixelMetric(QStyle::PM_SmallIconSize, 0, widget);
|
||||
const int iconSize = style->pixelMetric(QStyle::PM_SmallIconSize, nullptr, widget);
|
||||
const int delta = iconSize / 4 + iconSize + 6;
|
||||
r.setRight(r.right() + delta * numButtons);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace AzQtComponents
|
||||
};
|
||||
QMap<QObject*, ScrollAreaData> m_widgets;
|
||||
|
||||
void perScrollBar(QObject* scrollArea, void (QScrollBar::*callback)(void))
|
||||
void perScrollBar(QObject* scrollArea, void (QScrollBar::*callback)())
|
||||
{
|
||||
auto iterator = m_widgets.find(scrollArea);
|
||||
if (iterator != m_widgets.end())
|
||||
|
||||
@@ -632,7 +632,7 @@ namespace AzQtComponents
|
||||
return;
|
||||
}
|
||||
|
||||
ButtonPosition closeSide = (ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, this);
|
||||
ButtonPosition closeSide = (ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, nullptr, this);
|
||||
for (int i = 0; i < count(); i++)
|
||||
{
|
||||
QWidget* tabBtn = tabButton(i, closeSide);
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
if (auto editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<SimpleKeyedContainer>("SimpleKeyContainer", "")
|
||||
->DataElement(0, &SimpleKeyedContainer::m_map, "map", "")
|
||||
->DataElement(nullptr, &SimpleKeyedContainer::m_map, "map", "")
|
||||
->ElementAttribute(AZ::Edit::Attributes::ShowAsKeyValuePairs, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
AzQtComponents::registerMetaTypes();
|
||||
}
|
||||
|
||||
virtual ~AzQtComponentsTestEnvironment() {}
|
||||
~AzQtComponentsTestEnvironment() override {}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user