Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111862

onValueChanged()/subscribe()/addNotifier() should be const member function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.5.0 Beta3
    • Core: Other
    • None
    • All

      onValueChanged()/subscribe()/addNotifier() should be marked as const member function for QProperty<T> and its variants(QObjectBindableProperty, QObjectComputedProperty, QProperyAlias, and... maybe more?).

      Since watching value does not change the value itself, const member function makes sense.

      Futhermore, QPropertyChangeHandler and QPropertyNotifier take reference of property to const, so it seems that missing const qualifier is unintentional.

      This change won't break API compatibility, but I am not sure about ABI compatibility.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            fabiankosmale Fabian Kosmale
            xylosper Byoung-young Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes