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

Update ctkUtils adding qListToQSet and qSetToQList #1004

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Nov 3, 2021

These functions are useful to support building against Qt>=5.14 and avoid
warnings like the following:

  /path/to/S/Base/QTApp/qSlicerApplicationHelper.txx:170:55: warning: 'toSet' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
          moduleFactoryManager->registeredModuleNames().toSet() - moduleFactoryManager->instantiatedModuleNames().toSet());
                                                        ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qlist.h:412:5: note: 'toSet' has been explicitly marked deprecated here
      QT_DEPRECATED_VERSION_X_5_14("Use QSet<T>(list.begin(), list.end()) instead.")
      ^
  /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)))
                                                        ^  

  /path/to/S/Base/QTApp/qSlicerApplicationHelper.txx:169:64: warning: 'fromSet' is deprecated: Use QList<T>(set.begin(), set.end()) instead. [-Wdeprecated-declarations]
    QStringList failedToBeInstantiatedModuleNames = QStringList::fromSet(
                                                                 ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qlist.h:410:5: note: 'fromSet' has been explicitly marked deprecated here
      QT_DEPRECATED_VERSION_X_5_14("Use QList<T>(set.begin(), set.end()) instead.")
      ^
  /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 changed the title Ctk utils add q list to q set and q set to q list Update ctkUtils adding qListToQSet and qSetToQList Nov 3, 2021
@jcfr jcfr requested a review from lassoan November 4, 2021 16:05
@jcfr jcfr force-pushed the ctkUtils-add-qListToQSet-and-qSetToQList branch from 27fcddd to c9472cd Compare November 4, 2021 16:08
Libs/Core/ctkUtils.cpp Outdated Show resolved Hide resolved
Libs/Core/ctkUtils.cpp Outdated Show resolved Hide resolved
Libs/Core/ctkUtils.h Outdated Show resolved Hide resolved
@jcfr jcfr force-pushed the ctkUtils-add-qListToQSet-and-qSetToQList branch from c9472cd to f5c24fd Compare November 4, 2021 16:35
jcfr and others added 2 commits November 4, 2021 12:48
This function is useful to support building against Qt>=5.14 and avoid
warnings like the following:

  /path/to/S/Base/QTApp/qSlicerApplicationHelper.txx:170:55: warning: 'toSet' is deprecated: Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
          moduleFactoryManager->registeredModuleNames().toSet() - moduleFactoryManager->instantiatedModuleNames().toSet());
                                                        ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qlist.h:412:5: note: 'toSet' has been explicitly marked deprecated here
      QT_DEPRECATED_VERSION_X_5_14("Use QSet<T>(list.begin(), list.end()) instead.")
      ^
  /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)))
                                                        ^

Co-authored-by: Andras Lasso <[email protected]>
This function is useful to support building against Qt>=5.14 and avoid
warnings like the following:

  /path/to/S/Base/QTApp/qSlicerApplicationHelper.txx:169:64: warning: 'fromSet' is deprecated: Use QList<T>(set.begin(), set.end()) instead. [-Wdeprecated-declarations]
    QStringList failedToBeInstantiatedModuleNames = QStringList::fromSet(
                                                                 ^
  /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qlist.h:410:5: note: 'fromSet' has been explicitly marked deprecated here
      QT_DEPRECATED_VERSION_X_5_14("Use QList<T>(set.begin(), set.end()) instead.")
      ^
  /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)))
                                                        ^

Co-authored-by: Andras Lasso <[email protected]>
@jcfr jcfr force-pushed the ctkUtils-add-qListToQSet-and-qSetToQList branch from f5c24fd to 8559eba Compare November 4, 2021 16:48
@jcfr jcfr merged commit 19c36e2 into commontk:master Nov 4, 2021
@jcfr jcfr deleted the ctkUtils-add-qListToQSet-and-qSetToQList branch November 4, 2021 16:52
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.

2 participants