Skip to content

Commit

Permalink
Filter away static operators in namespaces
Browse files Browse the repository at this point in the history
This was introduced by Qt 6.7.3, where the static operators + and | on
Qt::Key and Qt::KeyModifiers were moved into the Qt namespace.
  • Loading branch information
usiems committed Oct 2, 2024
1 parent fe8bbe3 commit cf8998b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions generator/abstractmetabuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,10 +1137,15 @@ void AbstractMetaBuilder::traverseFunctions(ScopeModelItem scope_item, AbstractM
if (meta_function->isDestructor() && !meta_function->isFinal())
meta_class->setForceShellClass(true);

if (!meta_function->isDestructor()
&& !meta_function->isInvalid()
&& (!meta_function->isConstructor() || !meta_function->isPrivate())) {

if (meta_function->name().startsWith("__") && meta_function->isStatic()) {
// static operators are not supported by PythonQt
// (this only seems to happen for static operators in namespaces)
delete meta_function;
}
else if (!meta_function->isDestructor()
&& !meta_function->isInvalid()
&& (!meta_function->isConstructor() || !meta_function->isPrivate()))
{
if (meta_class->typeEntry()->designatedInterface() && !meta_function->isPublic()
&& !meta_function->isPrivate()) {
QString warn = QString("non-public function '%1' in interface '%2'")
Expand Down

0 comments on commit cf8998b

Please sign in to comment.