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

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

    XMLWordPrintable

Details

    • All

    Description

      Suggestions from a user:
      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

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes