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

QT_VERSION is now defined via QT_VERSION_CHECK

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.7.0
    • Build tools: moc
    • None

    Description

      Since https://codereview.qt-project.org/#/c/126105/, the QT_VERSION define is now an expansion of the QT_VERSION_CHECK macro, but moc doesn't process this macro. The result of this is that a signal or slot can no longer have a signature that is conditional by checking QT_VERSION, e.g.

      signals:
      #if QT_VERSION >= 0x050000
      void incomingConnection(qintptr descriptor);
      #else
      void incomingConnection(int descriptor);
      #endif
      

      works as expected with Qt < 5.7, but no longer compiles with Qt 5.7 as moc and gcc end up using different signatures.

      This is using qmake, on x86_64. I think I have traced this to the fact that x86_64 isn't defined when moc is run, but it is when gcc runs. This means __WORDSIZE gets defined incorrectly and moc tries to include qconfig-32.h instead of qconfig-64.h

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            tomhirst Tom Hirst
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes