Skip to content

Commit cf8998b

Browse files
committed
Filter away static operators in namespaces
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.
1 parent fe8bbe3 commit cf8998b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

generator/abstractmetabuilder.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,15 @@ void AbstractMetaBuilder::traverseFunctions(ScopeModelItem scope_item, AbstractM
11371137
if (meta_function->isDestructor() && !meta_function->isFinal())
11381138
meta_class->setForceShellClass(true);
11391139

1140-
if (!meta_function->isDestructor()
1141-
&& !meta_function->isInvalid()
1142-
&& (!meta_function->isConstructor() || !meta_function->isPrivate())) {
1143-
1140+
if (meta_function->name().startsWith("__") && meta_function->isStatic()) {
1141+
// static operators are not supported by PythonQt
1142+
// (this only seems to happen for static operators in namespaces)
1143+
delete meta_function;
1144+
}
1145+
else if (!meta_function->isDestructor()
1146+
&& !meta_function->isInvalid()
1147+
&& (!meta_function->isConstructor() || !meta_function->isPrivate()))
1148+
{
11441149
if (meta_class->typeEntry()->designatedInterface() && !meta_function->isPublic()
11451150
&& !meta_function->isPrivate()) {
11461151
QString warn = QString("non-public function '%1' in interface '%2'")

0 commit comments

Comments
 (0)