diff options
author | Christian Tismer <ctismer@gmail.com> | 2015-07-08 17:18:42 +0200 |
---|---|---|
committer | Christian Tismer <ctismer@gmail.com> | 2015-07-08 17:18:42 +0200 |
commit | 70afb33fd3e9e87ac86f635ba88e005af5eabf86 (patch) | |
tree | 07ae0fd5f12b5f04778dd1254df088ee4ac84610 | |
parent | 963ff1fdf0172bf6aa87660802432c208ffab56c (diff) |
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.
-rw-r--r-- | generator/shiboken/cppgenerator.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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; + } } } |