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

Port Qt code away from Q_FOREACH/foreach

    XMLWordPrintable

Details

    • Q_FOREACH

    Description

      Port all Qt code away from Q_FOREACH/foreach. According to Lars, this macro was never intended to be used in Qt code, yet it has infiltrated Qt code to a large extent. We can't deprecate it because users have thousands of uses all over the place, but we have QT_NO_FOREACH which can help keep our code base clean.

      Porting guide: https://www.kdab.com/goodbye-q_foreach/

      Acceptance criteria:

      • QT_NO_FOREACH is defined centrally for all Qt code (cf. QT_NO_AS_CONST, QT_NO_QEXCHANGE, ...).
      • only test code testing the foreach/Q_FOREACH is #undef'ing QT_NO_FOREACH at the top of the test

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-115796
          # Subject Branch Project Status CR V

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes