QGraphicsScene::render: fix int/qsizetype mismatch
Also suppresses the warning that we may be trying to allocate -1 items in call to new[]. Task-number: QTBUG-105388 Task-number: QTBUG-105471 Pick-to: 6.2 6.3 6.4 Change-Id: Ie4bb662dcb274440ab8bfffd17096d3606354647 Reviewed-by: Marc Mutz <marc.mutz@qt.io>bb10
parent
16d5468779
commit
70d040fa1a
|
|
@ -1780,8 +1780,8 @@ void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRect
|
|||
// in reverse order).
|
||||
QList<QGraphicsItem *> itemList = items(sourceRect, Qt::IntersectsItemBoundingRect);
|
||||
QGraphicsItem **itemArray = new QGraphicsItem *[itemList.size()];
|
||||
const int numItems = itemList.size();
|
||||
for (int i = 0; i < numItems; ++i)
|
||||
const qsizetype numItems = itemList.size();
|
||||
for (qsizetype i = 0; i < numItems; ++i)
|
||||
itemArray[numItems - i - 1] = itemList.at(i);
|
||||
itemList.clear();
|
||||
|
||||
|
|
@ -1798,7 +1798,7 @@ void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRect
|
|||
|
||||
// Generate the style options
|
||||
QStyleOptionGraphicsItem *styleOptionArray = new QStyleOptionGraphicsItem[numItems];
|
||||
for (int i = 0; i < numItems; ++i)
|
||||
for (qsizetype i = 0; i < numItems; ++i)
|
||||
itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painterTransform, targetRect.toRect());
|
||||
|
||||
// Render the scene.
|
||||
|
|
|
|||
Loading…
Reference in New Issue