QCustomPlot: Fix build with Qt 6.0

This commit is contained in:
Nodir Temirkhodjaev 2019-10-12 12:14:59 +05:00
parent c249d94af0
commit f1da128f89

View File

@ -11334,12 +11334,12 @@ QCPItemAnchor::QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentIte
QCPItemAnchor::~QCPItemAnchor()
{
// unregister as parent at children:
foreach (QCPItemPosition *child, mChildrenX.toList())
for (QCPItemPosition *child : mChildrenX)
{
if (child->parentAnchorX() == this)
child->setParentAnchorX(0); // this acts back on this anchor and child removes itself from mChildrenX
}
foreach (QCPItemPosition *child, mChildrenY.toList())
for (QCPItemPosition *child : mChildrenY)
{
if (child->parentAnchorY() == this)
child->setParentAnchorY(0); // this acts back on this anchor and child removes itself from mChildrenY
@ -11512,12 +11512,12 @@ QCPItemPosition::~QCPItemPosition()
// unregister as parent at children:
// Note: this is done in ~QCPItemAnchor again, but it's important QCPItemPosition does it itself, because only then
// the setParentAnchor(0) call the correct QCPItemPosition::pixelPosition function instead of QCPItemAnchor::pixelPosition
foreach (QCPItemPosition *child, mChildrenX.toList())
for (QCPItemPosition *child : mChildrenX)
{
if (child->parentAnchorX() == this)
child->setParentAnchorX(0); // this acts back on this anchor and child removes itself from mChildrenX
}
foreach (QCPItemPosition *child, mChildrenY.toList())
for (QCPItemPosition *child : mChildrenY)
{
if (child->parentAnchorY() == this)
child->setParentAnchorY(0); // this acts back on this anchor and child removes itself from mChildrenY