Fix narrowing in Qt::endPropertyUpdateGroup()
decltype(QPropertyDelayedNotifications::used) is qsizetype, not int, so don't use int to count from 0...used. The notify() and evaluateBinding() functions use their int argument only for pointer arithmetic, so this is completely self-contained. Amends fdedcb6ec650236bef4a8c8f005b5dd24ef7d77a. Manual conflict resolutions: - evaluateBindings() returns void in 6.2 Task-number: QTBUG-103532 Task-number: QTBUG-110710 Change-Id: I765a06628d330fbb57a2fbecc96d66690bb62f13 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d257a56c93e58028031c41daf90d3d4e8f317846) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
9687415262
commit
e04ab02b64
@ -154,7 +154,7 @@ struct QPropertyDelayedNotifications
|
||||
Change notifications are sent later with notify (following the logic of separating
|
||||
binding updates and notifications used in non-deferred updates).
|
||||
*/
|
||||
void evaluateBindings(int index, QBindingStatus *status) {
|
||||
void evaluateBindings(qsizetype index, QBindingStatus *status) {
|
||||
auto *delayed = delayedProperties + index;
|
||||
auto *bindingData = delayed->originalBindingData;
|
||||
if (!bindingData)
|
||||
@ -182,7 +182,7 @@ struct QPropertyDelayedNotifications
|
||||
\li sends any pending notifications.
|
||||
\endlist
|
||||
*/
|
||||
void notify(int index) {
|
||||
void notify(qsizetype index) {
|
||||
auto *delayed = delayedProperties + index;
|
||||
auto *bindingData = delayed->originalBindingData;
|
||||
if (!bindingData)
|
||||
@ -252,14 +252,14 @@ void Qt::endPropertyUpdateGroup()
|
||||
// update all delayed properties
|
||||
auto start = data;
|
||||
while (data) {
|
||||
for (int i = 0; i < data->used; ++i)
|
||||
for (qsizetype i = 0; i < data->used; ++i)
|
||||
data->evaluateBindings(i, status);
|
||||
data = data->next;
|
||||
}
|
||||
// notify all delayed properties
|
||||
data = start;
|
||||
while (data) {
|
||||
for (int i = 0; i < data->used; ++i)
|
||||
for (qsizetype i = 0; i < data->used; ++i)
|
||||
data->notify(i);
|
||||
auto *next = data->next;
|
||||
delete data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user