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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: