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

Make QT_NO_JAVA_STYLE_ITERATORS official

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0.0
    • None

      Please turn QT_NO_JAVA_STYLE_ITERATORS into an official consumer flag, like all the other flags listed with the docs of QT_ENABLE_STRICT_MODE_UP_TO, thus allowing to control the (non-)availability of that feature separately.

      Motivation:

      As developer trying to update one's code base to more modern style, it is helpful to concentrate on one aspect after another, turning into a short-time expert on each matter.

      Also once finished with that aspect, it is useful to protect against old patterns reappearing, to not have to relearn the update expert knowledge again and again.

      Java-style iterators could be considered such an aspect.

      More, playing with QT_ENABLE_STRICT_MODE_UP_TO, it comes a bit as a surprise that Java-style iterators are disabled since 6.0. As there have been no compiler deprecation warnings set up and the Qt 6.0 announcement at least had it not prominently mentioned, if at all. Only once looking targeted closer at the docs one can spot some "Note:New code should use STL-style iterators"

      Looking at the docs of QT_ENABLE_STRICT_MODE_UP_TO , one can see that the other disabled APIs all have their officially documented flag. So doing it for Java-style iterators would be just consistent. And now at 6.10, QT_NO_JAVA_STYLE_ITERATORS seems to have turned out as stable macro, so should also withstand consumer usage

      Making the macro QT_NO_JAVA_STYLE_ITERATORS official was already discussed when it was introduced in https://codereview.qt-project.org/c/qt/qtbase/+/262655, there people only delayed the decision into the future ("If we decide we want to let client code do similar, we can decide to document the macro then, and add a ChangeLog, "Exposed internal macro so that client code can use it too", when we do that.").

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

            mmutz Marc Mutz
            kossebau Friedrich W. H. Kossebau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes