From 70afb33fd3e9e87ac86f635ba88e005af5eabf86 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Wed, 8 Jul 2015 17:18:42 +0200 Subject: fixed a problem with qRegisterMetaType that came up with Qt5. The problem is that an unqualified name gets registered ("iterator") by some hard to understand heuristics of shiboken. This way, the same name is used for objects which have different size in Qt5, and therefore things crash. The quick fix was to skip exactly the name "iterator" and output a warning. This needs to be fixed in a better way, but costs too much time at the moment, because I don't understand enough about possible side-effects, yet. --- generator/shiboken/cppgenerator.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generator/shiboken/cppgenerator.cpp b/generator/shiboken/cppgenerator.cpp index b0753bcd7..7138b56ef 100644 --- a/generator/shiboken/cppgenerator.cpp +++ b/generator/shiboken/cppgenerator.cpp @@ -4444,8 +4444,16 @@ void CppGenerator::writeInitQtMetaTypeFunctionBody(QTextStream& s, const Abstrac } if (canBeValue) { - foreach (QString name, nameVariants) + foreach (QString name, nameVariants) { + if (name == "iterator") { + ReportHandler::warning(QString("%1:%2 FIXME:\n" + " The code tried to qRegisterMetaType the unqualified name " + "'iterator'. This is currently fixed by a hack(ct) and needs improvement!") + .arg(__FILE__).arg(__LINE__)); + continue; + } s << INDENT << "qRegisterMetaType< ::" << className << " >(\"" << name << "\");" << endl; + } } } -- cgit v1.2.3