Skip to content

Conversation

@jcfr
Copy link
Contributor

@jcfr jcfr commented Oct 26, 2025

This changes the initialization of m_type_flags to use TypeFlag::NoTypeFlags instead of 0. This resolves a deprecation warning related to the QFlags default constructor in Qt 5.15.2.

The warning fixed is:

/path/to/PythonQt/generator/typesystem.h:812:11: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = ComplexTypeEntry::TypeFlag; QFlags<T>::Zero = int QFlags<ComplexTypeEntry::TypeFlag>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  812 |           m_type_flags(0)
      |           ^~~~~~~~~~~~~~~
In file included from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qglobal.h:1304,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qalgorithms.h:43,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qlist.h:43,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/QList:1,
                 from /path/to/PythonQt/generator/parser/codemodel_fwd.h:46,
                 from /path/to/PythonQt/generator/parser/codemodel.h:46,
                 from /path/to/PythonQt/generator/abstractmetabuilder.h:45,
                 from /path/to/PythonQt/generator/abstractmetabuilder.cpp:42:
/path/to/Qt/5.15.2/gcc_64/include/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~

This changes the initialization of `m_type_flags` to use `TypeFlag::NoTypeFlags`
instead of 0. This resolves a deprecation warning related to the QFlags
default constructor in Qt 5.15.2.

The warning fixed is:

```
/path/to/PythonQt/generator/typesystem.h:812:11: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = ComplexTypeEntry::TypeFlag; QFlags<T>::Zero = int QFlags<ComplexTypeEntry::TypeFlag>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  812 |           m_type_flags(0)
      |           ^~~~~~~~~~~~~~~
In file included from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qglobal.h:1304,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qalgorithms.h:43,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qlist.h:43,
                 from /path/to/Qt/5.15.2/gcc_64/include/QtCore/QList:1,
                 from /path/to/PythonQt/generator/parser/codemodel_fwd.h:46,
                 from /path/to/PythonQt/generator/parser/codemodel.h:46,
                 from /path/to/PythonQt/generator/abstractmetabuilder.h:45,
                 from /path/to/PythonQt/generator/abstractmetabuilder.cpp:42:
/path/to/Qt/5.15.2/gcc_64/include/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
```
@usiems usiems merged commit 71be8c7 into MeVisLab:main Oct 27, 2025
17 checks passed
@jcfr jcfr deleted the fix-deprecated-qflags-warning branch October 28, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants