summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-04-27 15:02:10 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:15 -0300
commitea4968f5f31efba2df21514ae08beb1bef29031c (patch)
treef2e6c3e1af7e389ea70270e11688e0ca4e5933ed
parent3bb2bf375e52006c4880aff88f20344f5ccf1f87 (diff)
Fixed QVariant conversion for dictionary.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/QtCore/qvariant_conversions.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 73e2aa46..354955b7 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -97,7 +97,9 @@ struct Converter<QVariant>
//sequence and dictornay
if (PyDict_Check(pyObj)) {
- return convertToVariantMap(pyObj);
+ QVariant ret = convertToVariantMap(pyObj);
+ if (ret.isValid())
+ return ret;
} else if (PySequence_Check(pyObj)) {
return convertToVariantList(pyObj);
}
@@ -170,7 +172,7 @@ struct Converter<QVariant>
ret.insert(Converter<QString>::toCpp(key), toCpp(value));
return QVariant(ret);
} else {
- return toCpp(map);
+ return QVariant();
}
}