aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/pysidetest/typesystem_pysidetest.xml
blob: bf9c29386241113b7cca0234335377e6ce1187dd (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
58
59
60
61
62
63
64
<?xml version="1.0"?>
<typesystem package="testbinding">
    <load-typesystem name="QtWidgets/typesystem_widgets.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>
    <suppress-warning text="type 'QPyTextObject' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
    <!-- Qt5: I never really understood this warning. Probably it is because there
        is no way to instantiate the class. Anyway, why must this class emit this warning?
        I am not a C++ warrior, so I'd prefer if it would say "it is ok if you see this warning!".
        Well, maybe somebody will enlighten me, and I'll change this comment.
        I'd actually prefer an implementation that avoids generating this message, but I still failed
        doing so :-(
    -->
</typesystem>