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

QT_DISABLE_DEPRECATED_BEFORE hides wrong APIs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.5.0 Beta1
    • 6.2.4, 6.3.1, 6.4.0 Beta2
    • Core: Other
    • None
    • All
    • 5
    • 18f0484a0e (qt/qtbase/dev) 18f0484a0e (qt/tqtc-qtbase/dev)
    • Foundation Sprint 63, Foundation Sprint 64

      QT_DISABLE_DEPRECATED_BEFORE, as suggested by the name, is supposed to remove APIs that were deprecated before the specified version.

      However in practice it includes the specified version as well.

      I'm not sure if that is a bug or a bad naming. In the former case the fix can be as simple as

      diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
      index bbff1d2926b..e3f55d8d6f5 100644
      --- a/src/corelib/global/qglobal.h
      +++ b/src/corelib/global/qglobal.h
      @@ -291,7 +291,7 @@ typedef double qreal;
       
       */
       #ifdef QT_DEPRECATED
      -#define QT_DEPRECATED_SINCE(major, minor) (QT_VERSION_CHECK(major, minor, 0) > QT_DISABLE_DEPRECATED_BEFORE)
      +#define QT_DEPRECATED_SINCE(major, minor) (QT_VERSION_CHECK(major, minor, 0) >= QT_DISABLE_DEPRECATED_BEFORE)
       #else
       #define QT_DEPRECATED_SINCE(major, minor) 0
       #endif

      Otherwise we will probably need to update the name of the macro and corresponding documentation.

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

            ivan.solovev Ivan Solovev
            ivan.solovev Ivan Solovev
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: