diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-02-22 21:00:57 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-03-21 09:01:29 +0000 |
commit | c32b109e9dea44c6775c2dbf8f164870c1dc8971 (patch) | |
tree | 0945902a2242fd7ec0a1f7fd3e6acbb769e723bd | |
parent | 8704c640946ac852668638e2980d3e2b78aa27ae (diff) |
Simplify invocation of TableModel.roleDataProvider (toScriptValue)
After "QV4Engine: Unify fromValue and metaTypeToJS",
QJSEngine::toScriptValue(QModelIndex) is working correctly, so we don't
need the messy low-level technique with QV4::ExecutionEngine anymore.
Change-Id: I7df17ae75c11abd21fdc9ab4310c9ecf615b6a71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/qml/types/qqmltablemodel.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/types/qqmltablemodel.cpp b/src/qml/types/qqmltablemodel.cpp index c59a7584f7..6068155f5a 100644 --- a/src/qml/types/qqmltablemodel.cpp +++ b/src/qml/types/qqmltablemodel.cpp @@ -42,7 +42,6 @@ #include <QtCore/qloggingcategory.h> #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlengine.h> -#include <private/qv4engine_p.h> QT_BEGIN_NAMESPACE @@ -667,7 +666,7 @@ QVariant QQmlTableModel::data(const QModelIndex &index, int role) const if (mRoleDataProvider.isCallable()) { auto engine = qmlEngine(this); const auto args = QJSValueList() << - QJSValue(engine->handle(), engine->handle()->fromVariant(QVariant(QVariant::ModelIndex, &index))) << + engine->toScriptValue(index) << QString::fromUtf8(mRoleNames.value(role)) << engine->toScriptValue(rowData.at(column)); return const_cast<QQmlTableModel*>(this)->mRoleDataProvider.call(args).toVariant(); |