@@ -65,7 +65,7 @@ static QStringList getOperatorCodes(const AbstractMetaClass* cls) {
6565 }
6666 }
6767 QSet<QString> r;
68- foreach (QString op, operatorCodes.toList ()) {
68+ for (QString op : operatorCodes.toList ()) {
6969 if (op == " >" || op == " <" || op == " >=" || op == " <=" || op == " ==" || op == " !=" ) {
7070 r.insert (" PythonQt::Type_RichCompare" );
7171 } else if (op == " +" ) {
@@ -111,10 +111,10 @@ static QStringList getOperatorCodes(const AbstractMetaClass* cls) {
111111
112112 {
113113 CodeSnipList code_snips = cls->typeEntry ()->codeSnips ();
114- foreach (const CodeSnip &cs, code_snips) {
114+ for (const CodeSnip &cs : code_snips) {
115115 if (cs.language == TypeSystem::PyWrapperOperators) {
116116 QStringList values = cs.code ().split (" " , QString::SkipEmptyParts);
117- foreach (QString value, values) {
117+ for (QString value : values) {
118118 r.insert (value);
119119 }
120120 }
@@ -284,7 +284,7 @@ void SetupGenerator::generate()
284284
285285 QSet<QString> listRegistration;
286286 QSet<QString> snips;
287- foreach (const AbstractMetaClass *cls, list) {
287+ for (const AbstractMetaClass *cls : list) {
288288 Q_FOREACH (const AbstractMetaFunction* func, cls->functions ()) {
289289 if (func->type () && func->type ()->isContainer ()) {
290290 addListRegistration (func->type (), listRegistration);
@@ -298,7 +298,7 @@ void SetupGenerator::generate()
298298 {
299299 while (cls) {
300300 CodeSnipList code_snips = cls->typeEntry ()->codeSnips ();
301- foreach (const CodeSnip &cs, code_snips) {
301+ for (const CodeSnip &cs : code_snips) {
302302 if (cs.language == TypeSystem::PyInitSource) {
303303 snips.insert (cs.code ());
304304 }
@@ -308,7 +308,7 @@ void SetupGenerator::generate()
308308 }
309309 }
310310
311- foreach (QString snip, snips) {
311+ for (QString snip : snips) {
312312 s << snip;
313313 }
314314 s << endl;
@@ -335,7 +335,7 @@ void SetupGenerator::generate()
335335 const AbstractMetaClass* theclass = cls;
336336 while (theclass) {
337337 CodeSnipList code_snips = theclass->typeEntry ()->codeSnips ();
338- foreach (const CodeSnip &cs, code_snips) {
338+ for (const CodeSnip &cs : code_snips) {
339339 if (cs.language == TypeSystem::PySetWrapperFunc) {
340340 setInstanceFunc = cs.code ();
341341 break ;
@@ -358,7 +358,7 @@ void SetupGenerator::generate()
358358 QString baseName = cls->baseClass ()?cls->baseClass ()->qualifiedCppName ():" " ;
359359 s << " PythonQt::priv()->registerCPPClass(\" " << cls->qualifiedCppName () << " \" , \" " << baseName << " \" , \" " << shortPackName <<" \" , PythonQtCreateObject<PythonQtWrapper_" << cls->name () << " >" << shellCreator << " , module, " << operatorCodes <<" );" << endl;
360360 }
361- foreach (AbstractMetaClass* interface, cls->interfaces ()) {
361+ for (AbstractMetaClass* interface : cls->interfaces ()) {
362362 // the interface might be our own class... (e.g. QPaintDevice)
363363 if (interface->qualifiedCppName () != cls->qualifiedCppName ()) {
364364 s << " PythonQt::self()->addParentClass(\" " << cls->qualifiedCppName () << " \" , \" " << interface->qualifiedCppName () << " \" ,PythonQtUpcastingOffset<" << cls->qualifiedCppName () <<" ," <<interface->qualifiedCppName ()<<" >());" << endl;
@@ -408,7 +408,7 @@ QStringList SetupGenerator::writePolymorphicHandler(QTextStream &s, const QStrin
408408 if (isGraphicsItem) {
409409 const AbstractMetaClass *currentClazz = clazz;
410410 while (!inherits && currentClazz) {
411- foreach (AbstractMetaClass* interfaze, currentClazz->interfaces ()) {
411+ for (AbstractMetaClass* interfaze : currentClazz->interfaces ()) {
412412 if (interfaze->qualifiedCppName ()==" QGraphicsItem" ) {
413413 inherits = true ;
414414 break ;
0 commit comments