summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-11-09 16:09:01 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-11-09 16:15:57 -0300
commit9c6fb1d821065e61f85a59503dea63f4e7b49180 (patch)
tree9d88c50e5df13711a15ceeb406d7a361495bcfc7
parent9bb1956c20892af5379a2fa45b2c1e3af306dd25 (diff)
downloadshiboken-9c6fb1d821065e61f85a59503dea63f4e7b49180.tar.gz
shiboken-9c6fb1d821065e61f85a59503dea63f4e7b49180.tar.xz
shiboken-9c6fb1d821065e61f85a59503dea63f4e7b49180.zip
Fixed overload functions with QVariant.
Decrease the QVariant priority during the function overload. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--generator/overloaddata.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/generator/overloaddata.cpp b/generator/overloaddata.cpp
index 3ad657ab..ca0babc7 100644
--- a/generator/overloaddata.cpp
+++ b/generator/overloaddata.cpp
@@ -148,8 +148,10 @@ void OverloadData::sortNextOverloads()
bool checkPyObject = false;
int pyobjectIndex = 0;
bool checkQString = false;
- bool hasObjectPointer = false;
int qstringIndex = 0;
+ bool checkQVariant = false;
+ int qvariantIndex = 0;
+ bool hasObjectPointer = false;
// Primitive types that are not int, long, short,
// char and their respective unsigned counterparts.
@@ -175,6 +177,9 @@ void OverloadData::sortNextOverloads()
if (!checkPyObject && getTypeName(ov->argType()).contains("PyObject")) {
checkPyObject = true;
pyobjectIndex = sortData.lastProcessedItemId();
+ } else if (!checkQVariant && getTypeName(ov->argType()) == "QVariant") {
+ checkQVariant = true;
+ qvariantIndex = sortData.lastProcessedItemId();
} else if (!checkQString && getTypeName(ov->argType()) == "QString") {
checkQString = true;
qstringIndex = sortData.lastProcessedItemId();
@@ -275,6 +280,8 @@ void OverloadData::sortNextOverloads()
/* Add dependency on PyObject, so its check is the last one (too generic) */
if (checkPyObject && !targetTypeEntryName.contains("PyObject"))
graph.addEdge(sortData.map[targetTypeEntryName], pyobjectIndex);
+ else if (checkQVariant && targetTypeEntryName != "QVariant")
+ graph.addEdge(sortData.map[targetTypeEntryName], qvariantIndex);
else if (checkQString && hasObjectPointer && targetTypeEntryName != "QString")
graph.addEdge(sortData.map[targetTypeEntryName], qstringIndex);