Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #1010

Merged
merged 5 commits into from
Nov 5, 2021
Merged

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Nov 5, 2021

No description provided.

This commit fixes the warnings like the following reported when building
against Qt >= 5.15.

  In file included from /path/to/S-r/CTK/Libs/Widgets/ctkColorDialog.cpp:29:
  /path/to/S-rwdi/CTK/Libs/Widgets/ctkColorDialog.h:92:67: warning: 'QFlags' is deprecated: Use default constructor instead [-Wdeprecated-declarations]
                           const QString &title, ColorDialogOptions options = 0);
                                                                    ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qflags.h:123:5: note: 'QFlags' has been explicitly marked deprecated here
      QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
  #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                  ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                        ^
…ageHandler

This commit fixes the warnings like the following reported when building
against Qt >= 5.14.

  /path/to/S-r/CTK/Libs/Core/ctkErrorLogQtMessageHandler.cpp:70:57: warning: 'load' is deprecated: Use loadRelaxed [-Wdeprecated-declarations]
    if (ctkErrorLogQtMessageHandler_CurrentRecursionDepth.load() > 10)
                                                          ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:103:5: note: 'load' has been explicitly marked deprecated here
      QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") T load() const noexcept { return loadRelaxed(); }
      ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:366:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_5_14'
  # define QT_DEPRECATED_VERSION_X_5_14(text) QT_DEPRECATED_X(text)
                                              ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
  #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                  ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                        ^
@jcfr jcfr requested a review from lassoan November 5, 2021 08:43
Libs/Core/ctkUtils.cpp Outdated Show resolved Hide resolved
It fixes warnings like the following reported with Qt >= 5.14:

  /path/to/S-r/CTK/Libs/DICOM/Core/ctkDICOMIndexer.cpp:121:15: warning: 'start' is deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations]
      timeProbe.start();
                ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qdatetime.h:235:5: note: 'start' has been explicitly marked deprecated here
      QT_DEPRECATED_X("Use QElapsedTimer instead") void start();
      ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
  #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                  ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                        ^
…::ColorDialogOptions

This commit fixes warnings like the following reported when building
against Qt >= 5.15.

  /path/to/S-t/CTK/Libs/Widgets/ctkColorPickerButton.cpp:62:25: warning: 'QFlags' is deprecated: Use default constructor instead [-Wdeprecated-declarations]
    this->DialogOptions = 0;
                          ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qflags.h:123:5: note: 'QFlags' has been explicitly marked deprecated here
      QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
  #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                  ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                        ^
This commit fixes warnings like the following reported when building
against Qt >= 5.13.

  /path/to/S-r/CTK/Libs/Widgets/ctkPixmapIconEngine.cpp:187:27: warning: 'find' is deprecated: Use bool find(const QString &, QPixmap *) instead
        [-Wdeprecated-declarations]
          if (QPixmapCache::find(key + QString::number(static_cast<int>(mode)), pm))
                            ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtGui.framework/Headers/qpixmapcache.h:80:5: note: 'find' has been explicitly marked deprecated here
      QT_DEPRECATED_X("Use bool find(const QString &, QPixmap *) instead")
      ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
  #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                  ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
  #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                        ^
@jcfr jcfr merged commit 27f8940 into commontk:master Nov 5, 2021
@jcfr jcfr deleted the fix-deprecation-warnings branch November 5, 2021 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant