aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtNetwork/typesystem_network.xml43
1 files changed, 38 insertions, 5 deletions
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index f261f3a4d..fd47356fa 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -239,12 +239,45 @@
<enum-type name="PermissionSpec"/>
</value-type>
- <rejection class="QIPv6Address" field-name="c"/>
<value-type name="QIPv6Address">
- <!-- ### See bug 788 -->
- <modify-function signature="operator[](int)const" remove="all" />
- <modify-function signature="operator[](int)" remove="all" />
- <!-- ### -->
+ <add-function signature="__len__">
+ <inject-code class="target" position="beginning">
+ return 16;
+ </inject-code>
+ </add-function>
+ <add-function signature="__getitem__">
+ <inject-code class="target" position="beginning">
+ if (_i >= 16) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+ }
+
+ if (_i &lt; 0)
+ _i = 16 - abs(_i);
+
+ return %CONVERTTOPYTHON[uint](%CPPSELF->c[_i]);
+ </inject-code>
+ </add-function>
+ <add-function signature="__len__">
+ <inject-code class="target" position="beginning">
+ return 16;
+ </inject-code>
+ </add-function>
+ <add-function signature="__setitem__">
+ <inject-code class="target" position="beginning">
+ if (_i >= 16) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return -1;
+ }
+
+ if (_i &lt; 0)
+ _i = 16 - abs(_i);
+
+ %CPPSELF->c[_i] = %CONVERTTOCPP[quint8](_value);
+
+ return 0;
+ </inject-code>
+ </add-function>
</value-type>
<value-type name="QAuthenticator" />