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

COMP: Fix QModelIndex::child() deprecation warnings #1011

Merged

Commits on Nov 5, 2021

  1. COMP: Fix QModelIndex::child() deprecation warnings

    This commit introduces ctk::modelChildIndex() function so that the
    same code compiles without deprecation warnings pre and post Qt 5.8.
    
    It fixes warnings like the following:
    
      /path/to/S-r/CTK/Libs/DICOM/Core/ctkDICOMModel.cpp:745:32: warning: 'child' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
            this->setChildData(index.child(i,0), value, role);
                                     ^
      /path/to/Support/Qt/5.15.2/clang_64/lib/QtCore.framework/Headers/qabstractitemmodel.h:71:5: note: 'child' has been explicitly marked deprecated here
          QT_DEPRECATED_X("Use QAbstractItemModel::index") inline QModelIndex child(int row, int column) const;
          ^
      /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 committed Nov 5, 2021
    Configuration menu
    Copy the full SHA
    1bb9e5a View commit details
    Browse the repository at this point in the history