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

Teach moc to recognise direct use of the QFlags<> template

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.3, 6.0.2
    • Fix Version/s: 6.x
    • Component/s: Build tools: moc
    • Labels:
      None
    • Platform/s:
      All
    • Technical Risk:
      Normal

      Description

      At present, if moc has any special handling of Q_DECLARE_FLAGS(), it relies on the use of that macro. However, that macro is only needed because Q_NO_TYPESAFE_FLAGS can switch between it being a typedef to QFlags<Enum> or to uint; and it is surely no longer necessary to support the latter option. So the Q_NO_TYPESAFE_FLAGS is no longer defined anywhere and there is no good reason not to use typedef QFlags<Enum> Flags or using Flags = QFlags<Enum> overtly in the source code, in place of Q_DECLARE_FLAGS(Flags, Enum). Therefore moc needs to recognise all three forms equally, rather than depending on the macro-form.

      If moc either pays no attention to this macro, or already does recognise all three forms, there is of course nothing to do here; however, a code review elicited the observation that using the non-macro forms might fall afoul of moc not recognising them.

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            Eddy Edward Welbourne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes