From c32b109e9dea44c6775c2dbf8f164870c1dc8971 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 22 Feb 2019 21:00:57 +0100 Subject: 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 --- src/qml/types/qqmltablemodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/qml/types') 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 #include #include -#include 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(this)->mRoleDataProvider.call(args).toVariant(); -- cgit v1.2.3