[EMAIL PROTECTED] wrote:

Hi all,in my c++ include file (mediator.h) i've the following signal
void signalCallInProgress(const QHash<QString, QString>& activeCalls, const QHash<QString, QString>& holdCalls)

Now generator produces a file named qtjambishell_mediator.cpp with the following body that is not compiling because a redefinition of the iterators (it) used to
traverse the hash elements (activeCalls,holdCalls).


This is unfortunately a bug in the generator. I've attached a patch which should fix the problem. Could you try applying this and see if it helps?

-- Eskil


==== generator/cppimplgenerator.cpp#10 - generator\cppimplgenerator.cpp ====
@@ -2666,17 +2666,19 @@
           << INDENT << "jobject " << java_name << " = " << constructor << 
"(__jni_env, " << qt_name
           << ".size());" << endl
           << INDENT;
+        QString iteratorName = "__qt_" + qt_name + "_it";
         writeTypeInfo(s, java_type, Option(ExcludeReference | ExcludeConst));
-        s << "::const_iterator it;" << endl
-          << INDENT << "for (it=" << qt_name << ".constBegin(); it!=" << 
qt_name << ".constEnd(); ++it) {" << endl;
+        s << "::const_iterator " << iteratorName << ";" << endl
+          << INDENT << "for (" << iteratorName << "=" << qt_name << 
".constBegin(); "  
+                    << iteratorName << "!=" << qt_name << ".constEnd(); ++" << 
iteratorName << ") {" << endl;
         {
             Indentation indent(INDENT);
             s << INDENT;
             writeTypeInfo(s, targ_key);
-            s << " __qt_tmp_key = it.key();" << endl
+            s << " __qt_tmp_key = " << iteratorName << ".key();" << endl
               << INDENT;
             writeTypeInfo(s, targ_val);
-            s << " __qt_tmp_val = it.value();" << endl;
+            s << " __qt_tmp_val = " << iteratorName << ".value();" << endl;
             writeQtToJava(s, targ_key, "__qt_tmp_key", "__java_tmp_key", 0, 
-1, BoxedPrimitive);
             writeQtToJava(s, targ_val, "__qt_tmp_val", "__java_tmp_val", 0, 
-1, BoxedPrimitive);
             s << INDENT << "qtjambi_map_put(__jni_env, " << java_name
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to