aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/typesystem_templates.xml
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-02-27 14:44:39 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-03-01 13:56:16 +0000
commit6c0a0d70305cd6e12260a352099e74d34f3c239e (patch)
treeda2df8451c284ef91fdeea76ae6f24315bf03864 /sources/pyside2/PySide2/typesystem_templates.xml
parent85e14a0d72b3470748e3cbe8871e23a818820ee9 (diff)
Fix QValidator fixup() behavior
The return value from the fixup() method was ignored leaving an Intermediate or Invalid input intact. This was solved injecting code to the native wrapper for the fixup() method that allows to change its value. A test case is provided. Task-number: PYSIDE-106 Change-Id: I1d796955178dbdbcfff90adb6ede5c8b2dd1acc3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/typesystem_templates.xml')
-rw-r--r--sources/pyside2/PySide2/typesystem_templates.xml6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/typesystem_templates.xml b/sources/pyside2/PySide2/typesystem_templates.xml
index 7ac4ac158..e0b47b6e3 100644
--- a/sources/pyside2/PySide2/typesystem_templates.xml
+++ b/sources/pyside2/PySide2/typesystem_templates.xml
@@ -278,6 +278,12 @@
<template name="return_QString">
%PYARG_0 = %CONVERTTOPYTHON[QString](%1);
</template>
+ <template name="return_QString_native">
+ if (%ISCONVERTIBLE[QString](%PYARG_0))
+ %1 = %CONVERTTOCPP[QString](%PYARG_0);
+ else
+ qWarning("%TYPE::%FUNCTION_NAME: Argument is not convertible to unicode.");
+ </template>
<template name="return_tuple_QValidator_QString_int">
%BEGIN_ALLOW_THREADS