Skip to content

Commit

Permalink
qproperty_p.h: fix -Wshadow in notify()
Browse files Browse the repository at this point in the history
Clang warning:
.../qproperty_p.h:666:58: warning: declaration shadows a local variable [-Wshadow]
  666 |                             if (QPropertyObserverPointer observer = d.firstObserver())
      |                                                          ^
.../qproperty_p.h:660:46: note: previous declaration is here
  660 |                 if (QPropertyObserverPointer observer = d.firstObserver()) {
      |

Fix by abbreviating the variable name in if statement.

Pick-to: 6.8
Change-Id: I7905de08f15124466f8aa587691b2880c889199f
Reviewed-by: Ulf Hermann <[email protected]>
  • Loading branch information
stampho committed Nov 15, 2024
1 parent 2c03507 commit 2fc5735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/corelib/kernel/qproperty_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ class QObjectCompatProperty : public QPropertyData<T>
if (bd->notifyObserver_helper(this, storage, observer, bindingObservers)
== QtPrivate::QPropertyBindingData::Evaluated) {
// evaluateBindings() can trash the observers. We need to re-fetch here.
if (QPropertyObserverPointer observer = d.firstObserver())
observer.notify(this);
if (QPropertyObserverPointer obs = d.firstObserver())
obs.notify(this);
for (auto&& bindingPtr: bindingObservers) {
auto *binding = static_cast<QPropertyBindingPrivate *>(bindingPtr.get());
binding->notifyNonRecursive();
Expand Down

0 comments on commit 2fc5735

Please sign in to comment.