Moved internalPointer methods code injection into a code template.
This commit is contained in:
parent
c0d6e44acc
commit
f957a6f42d
2 changed files with 8 additions and 8 deletions
|
|
@ -985,10 +985,7 @@
|
||||||
<value-type name="QPersistentModelIndex">
|
<value-type name="QPersistentModelIndex">
|
||||||
<modify-function signature="internalPointer()const">
|
<modify-function signature="internalPointer()const">
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
%PYARG_0 = (PyObject*)%CPPSELF.%FUNCTION_NAME();
|
<insert-template name="return_internal_pointer" />
|
||||||
if (!%PYARG_0)
|
|
||||||
%PYARG_0 = Py_None;
|
|
||||||
Py_XINCREF(%PYARG_0);
|
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="operator const QModelIndex&()const">
|
<modify-function signature="operator const QModelIndex&()const">
|
||||||
|
|
@ -2825,10 +2822,7 @@
|
||||||
<value-type name="QModelIndex">
|
<value-type name="QModelIndex">
|
||||||
<modify-function signature="internalPointer()const">
|
<modify-function signature="internalPointer()const">
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
%PYARG_0 = (PyObject*)%CPPSELF.%FUNCTION_NAME();
|
<insert-template name="return_internal_pointer" />
|
||||||
if (!%PYARG_0)
|
|
||||||
%PYARG_0 = Py_None;
|
|
||||||
Py_XINCREF(%PYARG_0);
|
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="model()const">
|
<modify-function signature="model()const">
|
||||||
|
|
|
||||||
|
|
@ -272,6 +272,12 @@
|
||||||
%PYARG_0 = PyString_FromString(qPrintable(format));
|
%PYARG_0 = PyString_FromString(qPrintable(format));
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template name="return_internal_pointer">
|
||||||
|
%PYARG_0 = reinterpret_cast<PyObject*>(%CPPSELF.%FUNCTION_NAME());
|
||||||
|
if (!%PYARG_0)
|
||||||
|
%PYARG_0 = Py_None;
|
||||||
|
Py_INCREF(%PYARG_0);
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- templates for __reduce__ -->
|
<!-- templates for __reduce__ -->
|
||||||
<template name="reduce_code">
|
<template name="reduce_code">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue