@@ -304,13 +304,13 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla
304304 }
305305 }
306306 s << " (" ;
307- if (scriptFunctionName.startsWith (" operator>>" )) {
307+ if (scriptFunctionName.startsWith (" operator>>" ) && !fun-> wasProtected () ) {
308308 s << wrappedObject << " >>" << args.at (0 )->argumentName ();
309- } else if (scriptFunctionName.startsWith (" operator<<" )) {
309+ } else if (scriptFunctionName.startsWith (" operator<<" ) && !fun-> wasProtected () ) {
310310 s << wrappedObject << " <<" << args.at (0 )->argumentName ();
311- } else if (scriptFunctionName.startsWith (" operator[]" )) {
311+ } else if (scriptFunctionName.startsWith (" operator[]" ) && !fun-> wasProtected () ) {
312312 s << wrappedObject << " [" << args.at (0 )->argumentName () << " ]" ;
313- } else if (scriptFunctionName.startsWith (" operator" ) && args.size ()==1 ) {
313+ } else if (scriptFunctionName.startsWith (" operator" ) && args.size ()==1 && !fun-> wasProtected () ) {
314314 QString op = scriptFunctionName.mid (8 );
315315 s << wrappedObject << op << " " << args.at (0 )->argumentName ();
316316 } else {
@@ -328,7 +328,13 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla
328328 s << " theWrappedObject->" ;
329329 }
330330 }
331- s << fun->originalName () << " (" ;
331+ if (fun->wasProtected ()) {
332+ // this is different e.g. for operators
333+ s << fun->name () << " (" ;
334+ }
335+ else {
336+ s << fun->originalName () << " (" ;
337+ }
332338 for (int i = 0 ; i < args.size (); ++i) {
333339 if (i > 0 )
334340 s << " , " ;
0 commit comments