tst_QGraphicsWidget: remove unneeded casts in setStyle()

`fstyle` is already a QStyle*, so casting it to QStyle* is unneeded.

Amends 9bc49b0bca361646aac90cd00706588d3dcd66c9.

And 0 is a valid nullptr value, so we don't need to cast there,
either.

Amends the start of the public history.

Drive-by port to nullptr.

Pick-to: 6.9 6.8 6.5 5.15
Change-Id: If763b8bf42de9d8bbe988ac76773d02bb7a2b68b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Marc Mutz 2025-03-28 09:21:28 +01:00
parent 156bd55923
commit dbfcd54155

View File

@ -1360,10 +1360,10 @@ void tst_QGraphicsWidget::setStyle()
if (!style.isEmpty()) {
QStyle *fstyle = QStyleFactory::create(style);
widget.setStyle(fstyle);
QCOMPARE(widget.style(), static_cast<QStyle*>(fstyle));
QCOMPARE(widget.style(), fstyle);
} else {
widget.setStyle(0);
QVERIFY(widget.style() != (QStyle *)0);
QVERIFY(widget.style() != nullptr);
}
QCOMPARE(widget.eventCount, oldEventCounts + 1);
QCOMPARE(widget.testAttribute(Qt::WA_SetStyle), !style.isEmpty());