From 9f52793a68e9b7879331fe8399ff9709a5d5c558 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 8 Nov 2018 14:51:00 +0100 Subject: Remove createIndex method that uses PyObject* We have a proper `void*` treatment, so the extra function does not seems to be necessary. The injected code used for the interalPointer method was also removed since is better to leave on shiboken hands the conversion between void* and python types. A couple of test were adapted since wrongly used ModelIndex with Python objects. Change-Id: I082637c7d1dd1bb0f50a3c453513e5d722f4b783 Reviewed-by: Qt CI Bot Reviewed-by: Alexandru Croitor --- .../PySide2/QtCore/typesystem_core_common.xml | 34 ---------------------- sources/pyside2/PySide2/typesystem_templates.xml | 7 ----- .../tests/QtCore/qabstractitemmodel_test.py | 4 +-- .../QtCore/qmodelindex_internalpointer_test.py | 23 ++++++++------- 4 files changed, 13 insertions(+), 55 deletions(-) (limited to 'sources/pyside2') diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index cff7e0af0..3b5d9f520 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -1827,11 +1827,6 @@ - - - - - @@ -2101,36 +2096,12 @@ - - - - - - - - - - - - - - %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3); - %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); - - - Creates a model index for the given row and column with the internal pointer ptr. - When using a QSortFilterProxyModel, its indexes have their own internal pointer. It is not advisable to access this internal pointer outside of the model. Use the data() function instead. - This function provides a consistent interface that model subclasses must use to create model indexes. - - .. warning:: Because of some Qt/Python itegration rules, the ptr argument do not get the reference incremented during the QModelIndex life time. So it is necessary to keep the object used on ptr argument alive during the whole process. Do not destroy the object if you are not sure about that. - - qRegisterMetaType<QVector<int> >("QVector<int>"); @@ -3890,11 +3861,6 @@ - - - - - diff --git a/sources/pyside2/PySide2/typesystem_templates.xml b/sources/pyside2/PySide2/typesystem_templates.xml index 1cac1a6ba..f0e4a2bf8 100644 --- a/sources/pyside2/PySide2/typesystem_templates.xml +++ b/sources/pyside2/PySide2/typesystem_templates.xml @@ -354,13 +354,6 @@ %PYARG_0 = Shiboken::String::fromCString(qPrintable(format)); - -