diff options
Diffstat (limited to 'tests/samplebinding/typesystem_sample.xml')
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 547710a52..be0f8fe88 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -137,6 +137,22 @@ %PYARG_0 = %CONVERTTOPYTHON[int](%1 + %2); </inject-code> </add-function> + <add-function signature="passReferenceToValueType(Point&)" return-type="double"> + <inject-code> + double %0 = %1.x() + %1.y(); + %PYARG_0 = %CONVERTTOPYTHON[double](%0); + </inject-code> + </add-function> + + <!-- Do change the argument from pointer to reference to comply with the C++ overload + of this function. The generator must be able to deal with this for Object Types. --> + <add-function signature="passReferenceToObjectType(ObjectType*)" return-type="int"> + <inject-code> + // The dot in "%1." must be replaced by a "->". + double %0 = %1.objectName().size(); + %PYARG_0 = %CONVERTTOPYTHON[int](%0); + </inject-code> + </add-function> </namespace-type> <namespace-type name="RemovedNamespace1" generate='no'> @@ -1711,5 +1727,7 @@ <suppress-warning text="template baseclass 'std::list<T>' of 'QList' is not known" /> <suppress-warning text="template baseclass 'std::list<Str>' of 'StrList' is not known" /> -</typesystem> + <!-- Do not fix this warning, the generator should be able to handle this situation for Object Types. --> + <suppress-warning text="Argument in position 1 of added function 'SampleNamespace::passReferenceToObjectType(ObjectType * arg__1)', has a type that is not a reference, while the argument in the corresponding position in C++ function 'SampleNamespace::passReferenceToObjectType(const ObjectType & obj, int multiplier)' is a reference." /> +</typesystem> |