summaryrefslogtreecommitdiffstats
path: root/tests/pysidetest/typesystem_pysidetest.xml
blob: babb541d2196418cfa4ccfa3a4a52391b9d99107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0"?>
<typesystem package="testbinding">
    <load-typesystem name="typesystem_core.xml" generate="no" />
    <load-typesystem name="typesystem_gui.xml" generate="no"/>
    <value-type name="IntValue"/>
    <primitive-type name="TypedefValue">
        <!--
        A conversion rule is used here because ApiExtractor can't associate
        a primitive typedef to a non-primitive type. That would be a good
        improvement to ApiExtractor.
        -->
        <conversion-rule>
            <native-to-target>
            return %CONVERTTOPYTHON[IntValue](%in);
            </native-to-target>
            <target-to-native>
                <add-conversion type="IntValue">
                IntValue value = %CONVERTTOCPP[IntValue](%in);
                %out = %OUTTYPE(value);
                </add-conversion>
            </target-to-native>
        </conversion-rule>
    </primitive-type>
    <object-type name="TestObject" />

    <primitive-type name="PySideInt"/>
    <primitive-type name="PySideCPP2::PySideLong"/>
    <!--<primitive-type name="PySideLong"/>-->

    <function signature="getHiddenObject()" />

    <inject-code position="end">
    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), "PySideLong");
    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), "PySideCPP2::PySideLong");
    qRegisterMetaType&lt;PySideInt>("PySideInt");
    qRegisterMetaType&lt;PySideCPP2::PySideLong>("PySideLong");
    </inject-code>

    <namespace-type name="PySideCPP">
        <object-type name="TestObjectWithNamespace"/>
    </namespace-type>

    <namespace-type name="PySideCPP2" generate="no">
        <enum-type name="Enum1" />
        <object-type name="TestObjectWithoutNamespace">
            <enum-type name="Enum2" />
        </object-type>
    </namespace-type>

    <object-type name="TestView" >
        <modify-function signature="TestView(QAbstractListModel*,QObject*)">
            <modify-argument index="1">
                <reference-count action="set"/>
            </modify-argument>
        </modify-function>
    </object-type>
</typesystem>