Hello Phil,

The good folks at the Pardus Linux distribution brought a bug to my attention where QHash<String,QVariant> objects (aka QVariantHash) would be mapped to empty Python dicts.

I've dug into the SIP and PyQt and found the problem and have simple fix. See the attached patch.

This bug affects a rather important part of the KDE desktop (plasmoids), and therefore directly affects the Pardus release (due in ~2 weeks) and the KDE 4.3 release (due end of this month). An updated PyQt would be very welcome, the sooner the better.

cheers,

--
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
[email protected]       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."
diff -dur PyQt-x11-gpl-4.5.1_orig/qpy/QtCore/qpycore_chimera.cpp PyQt-x11-gpl-4.5.1/qpy/QtCore/qpycore_chimera.cpp
--- PyQt-x11-gpl-4.5.1_orig/qpy/QtCore/qpycore_chimera.cpp	2009-06-16 10:37:46.000000000 +0200
+++ PyQt-x11-gpl-4.5.1/qpy/QtCore/qpycore_chimera.cpp	2009-07-08 19:46:55.313316975 +0200
@@ -1240,12 +1240,12 @@
 #if QT_VERSION >= 0x040500
     case QMetaType::QVariantHash:
         {
-            QVariantHash qh = reinterpret_cast<QVariant *>(cpp)->toHash();
+            QVariantHash *qh = reinterpret_cast<QVariantHash *>(cpp);
 
             py = PyDict_New();
 
             if (py)
-                for (QVariantHash::const_iterator it = qh.constBegin(); it != qh.constEnd(); ++it)
+                for (QVariantHash::const_iterator it = qh->constBegin(); it != qh->constEnd(); ++it)
                     if (!add_variant_to_dict(py, it.key(), it.value()))
                     {
                         Py_DECREF(py);
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to