Decouple pie and hole size setters

Removes logic that caused setPieSize() and setHoleSize() to implicitly
modify each other. The setters now only affect their own respective
properties.

Pick-to: 6.9 6.8
Fixes: QTBUG-134003
Change-Id: I2d7b3e36d692248cd2de19dc6daa9d09a61c8158
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
(cherry picked from commit e2def3779a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Kwanghyo Park 2025-08-18 12:07:21 +03:00 committed by Qt Cherry-pick Bot
parent 07c44e94e0
commit 39c5cdc6f8
2 changed files with 4 additions and 4 deletions

View File

@ -1007,7 +1007,7 @@ void QPieSeries::setPieSize(qreal relativeSize)
{
Q_D(QPieSeries);
relativeSize = qBound((qreal)0.0, relativeSize, (qreal)1.0);
d->setSizes(qMin(d->m_holeRelativeSize, relativeSize), relativeSize);
d->setSizes(d->m_holeRelativeSize, relativeSize);
}
qreal QPieSeries::pieSize() const
@ -1150,7 +1150,7 @@ void QPieSeries::setHoleSize(qreal holeSize)
{
Q_D(QPieSeries);
holeSize = qBound((qreal)0.0, holeSize, (qreal)1.0);
d->setSizes(holeSize, qMax(d->m_pieRelativeSize, holeSize));
d->setSizes(holeSize, d->m_pieRelativeSize);
}
qreal QPieSeries::holeSize() const

View File

@ -112,11 +112,11 @@ void tst_qgpieseries::properties()
m_series->setHoleSize(0.8);
QCOMPARE(m_series->holeSize(), 0.8);
QCOMPARE(m_series->pieSize(), 0.8);
QCOMPARE(m_series->pieSize(), 0.7);
m_series->setPieSize(0.4);
QCOMPARE(m_series->pieSize(), 0.4);
QCOMPARE(m_series->holeSize(), 0.4);
QCOMPARE(m_series->holeSize(), 0.8);
m_series->setStartAngle(0);
m_series->setStartAngle(-180);