chore(generator): Fix deprecated QFlags default constructor warning#320
Merged
usiems merged 1 commit intoMeVisLab:mainfrom Oct 27, 2025
Merged
chore(generator): Fix deprecated QFlags default constructor warning#320usiems merged 1 commit intoMeVisLab:mainfrom
usiems merged 1 commit intoMeVisLab:mainfrom
Conversation
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) {}
| ^~~~~~
```
mrbean-bremen
approved these changes
Oct 27, 2025
usiems
approved these changes
Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the initialization of
m_type_flagsto useTypeFlag::NoTypeFlagsinstead of 0. This resolves a deprecation warning related to the QFlags default constructor in Qt 5.15.2.The warning fixed is: