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

qmlintegration.h macros cause GCC -Wredundant-decls

    XMLWordPrintable

Details

    • df3c82f6a (dev), 2b772c92a (6.7)

    Description

      After QTBUG-115583 reported that GCC's -Wredundant-decls got triggered in QPageSize, I tried adding that flag to headersclean. This brought to light that various QML_ macros contain a friend declaration for QML_REGISTER_TYPES_AND_REVISIONS. If a type such as QtGraph's QAbstractAxis contains more than one of these macros (in that case QML_FOREIGN and QML_UNCREATABLE), the friend declaration is duplicated in the macro expanded class declaration, triggering -Wredundant-decls.

      Solutions could be to combine the macros, so only one is necessary (QML_UNCREATABLE_FOREIGN) or each macro giving access to a different struct, which then is used by qmlRegisterTypesAndRevisions to access the relevant parts of the actual class.

      Attachments

        Issue Links

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

          Activity

            People

              fabiankosmale Fabian Kosmale
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change