From f1efdb342224cfb1e22b55ae4c704635edbbf46a Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 17 Nov 2009 13:54:56 +1000 Subject: Fix binding (it should be resulted to arrays, since SQL and JS are not) --- src/declarative/qml/qmlsqldatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp index 330d904..6e32fb7 100644 --- a/src/declarative/qml/qmlsqldatabase.cpp +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -248,10 +248,10 @@ static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEn QSqlQuery query(db); bool err = false; if (query.prepare(sql)) { - if (values.isArray()) { + if (values.isObject()) { for (QScriptValueIterator it(values); it.hasNext();) { it.next(); - query.addBindValue(it.value().toVariant()); + query.bindValue(it.name(),it.value().toVariant()); } } else { query.bindValue(0,values.toVariant()); -- cgit v0.12