<?xml version="1.0"?>
<!--
    This file is part of PySide project.
    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
    Contact: PySide team <contact@pyside.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-->
<typesystem package="PySide.QtGui">
  <load-typesystem name="typesystem_core.xml" generate="no"/>

  <template name="QFontCharFix">
    int size = Shiboken::String::len(%PYARG_1);
    if (size == 1) {
        const char *str = Shiboken::String::toCString(%PYARG_1);
        QChar ch(str[0]);
        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ch);
        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
    } else {
        PyErr_SetString(PyExc_TypeError, "String must have only one character");
    }
  </template>

  <function signature="qAlpha(uint)" />
  <function signature="qBlue(uint)" />
  <function signature="qGray(int,int,int)" />
  <function signature="qGray(uint)" />
  <function signature="qGreen(uint)" />
  <function signature="qIsGray(uint)" />
  <function signature="qRed(uint)" />
  <function signature="qRgb(int,int,int)" />
  <function signature="qRgba(int,int,int,int)" />
  <function signature="qFuzzyCompare(QMatrix,QMatrix)" />
  <function signature="qFuzzyCompare(QTransform,QTransform)" />
  <function signature="qFuzzyCompare(QQuaternion,QQuaternion)" />
  <function signature="qFuzzyCompare(QMatrix4x4,QMatrix4x4)" />
  <function signature="qFuzzyCompare(QVector2D,QVector2D)" />
  <function signature="qFuzzyCompare(QVector3D,QVector3D)" />
  <function signature="qFuzzyCompare(QVector4D,QVector4D)" />
  <rejection class="*" function-name="qobject_interface_iid&lt;QStyleFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QAccessibleFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QInputContextFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QGraphicsItem*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QGraphicsLayout*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QAccessibleBridgeFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QImageIOHandlerFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QIconEngineFactoryInterfaceV2*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QAccessibleInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QTextObjectInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QGraphicsLayoutItem*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QIconEngineFactoryInterface*&gt;"/>
  <rejection class="*" function-name="qobject_interface_iid&lt;QPictureFormatInterface*&gt;"/>

  <rejection class="*" function-name="qobject_cast&lt;QGraphicsLayout*&gt;"/>
  <rejection class="*" function-name="qobject_cast&lt;QGraphicsItem*&gt;"/>
  <rejection class="*" function-name="qobject_cast&lt;QGraphicsLayoutItem*&gt;"/>
  <rejection class="*" function-name="qobject_cast&lt;QGraphicsLayoutItem*&gt;"/>

  <rejection class="*" function-name="qGenericMatrixFromMatrix4x4"/>
  <rejection class="*" function-name="qDrawBorderPixmap"/>
  <rejection class="*" function-name="qDrawPixmaps"/>
  <rejection class="*" function-name="qGenericMatrixToMatrix4x4"/>

  <rejection class="*" function-name="d_func"/>
  <rejection class="*" field-name="d_ptr"/>
  <rejection class="*" field-name="d"/>

  <!--
    Event classes have a lot of non-documented protected fields, those fields
    are removed from PySide because they are Qt implementation details,
    besides the fact they are accessible by ordinary event methods.
    -->

  <rejection class="QInputEvent" field-name="modState"/>
  <rejection class="QInputEvent" field-name="modState"/>

  <rejection class="QMouseEvent" field-name="p"/>
  <rejection class="QMouseEvent" field-name="g"/>
  <rejection class="QMouseEvent" field-name="b"/>
  <rejection class="QMouseEvent" field-name="mouseState"/>

  <rejection class="QHoverEvent" field-name="p"/>
  <rejection class="QHoverEvent" field-name="op"/>

  <rejection class="QWheelEvent" field-name="p"/>
  <rejection class="QWheelEvent" field-name="g"/>
  <rejection class="QWheelEvent" field-name="mouseState"/>
  <rejection class="QWheelEvent" field-name="o"/>

  <rejection class="QTabletEvent" field-name="mPos"/>
  <rejection class="QTabletEvent" field-name="mGPos"/>
  <rejection class="QTabletEvent" field-name="mHiResGlobalPos"/>
  <rejection class="QTabletEvent" field-name="mDev"/>
  <rejection class="QTabletEvent" field-name="mPointerType"/>
  <rejection class="QTabletEvent" field-name="mXT"/>
  <rejection class="QTabletEvent" field-name="mYT"/>
  <rejection class="QTabletEvent" field-name="mZ"/>
  <rejection class="QTabletEvent" field-name="mPress"/>
  <rejection class="QTabletEvent" field-name="mTangential"/>
  <rejection class="QTabletEvent" field-name="mRot"/>
  <rejection class="QTabletEvent" field-name="mUnique"/>
  <rejection class="QTabletEvent" field-name="mExtra"/>

  <rejection class="QKeyEvent" field-name="txt"/>
  <rejection class="QKeyEvent" field-name="k"/>
  <rejection class="QKeyEvent" field-name="c"/>
  <rejection class="QKeyEvent" field-name="auto"/>

  <rejection class="QPaintEvent" field-name="m_rect"/>
  <rejection class="QPaintEvent" field-name="m_region"/>
  <rejection class="QPaintEvent" field-name="m_erased"/>

  <rejection class="QMoveEvent" field-name="p"/>
  <rejection class="QMoveEvent" field-name="oldp"/>

  <rejection class="QResizeEvent" field-name="s"/>
  <rejection class="QResizeEvent" field-name="olds"/>

  <rejection class="QContextMenuEvent" field-name="p"/>
  <rejection class="QContextMenuEvent" field-name="gp"/>
  <rejection class="QContextMenuEvent" field-name="reas"/>

  <rejection class="QDropEvent" field-name="p"/>
  <rejection class="QDropEvent" field-name="mouseState"/>
  <rejection class="QDropEvent" field-name="modState"/>
  <rejection class="QDropEvent" field-name="act"/>
  <rejection class="QDropEvent" field-name="drop_action"/>
  <rejection class="QDropEvent" field-name="default_action"/>
  <rejection class="QDropEvent" field-name="mdata"/>
  <rejection class="QDropEvent" field-name="fmts"/>

  <rejection class="QDragMoveEvent" field-name="rect"/>

  <rejection class="QShortcutEvent" field-name="sequence"/>
  <rejection class="QShortcutEvent" field-name="ambig"/>
  <rejection class="QShortcutEvent" field-name="sid"/>

  <rejection class="QTouchEvent" field-name="_widget"/>
  <rejection class="QTouchEvent" field-name="_deviceType"/>
  <rejection class="QTouchEvent" field-name="_touchPointStates"/>
  <rejection class="QTouchEvent" field-name="_touchPoints"/>

  <rejection class="QAbstractTextDocumentLayout::PaintContext" field-name="selections"/>
  <rejection class="QApplication" function-name="compressEvent"/>
  <rejection class="QBrush" function-name="cleanUp"/>
  <rejection class="QFont" enum-name="ResolveProperties"/>
  <rejection class="QMotifStyle" field-name="focus"/>
  <rejection class="QPictureIO" function-name="defineIOHandler"/>
  <rejection class="QPolygon" function-name="putPoints"/>
  <rejection class="QPolygon" function-name="setPoints"/>
  <rejection class="QPolygon" function-name="setPoint"/>
  <rejection class="QPolygon" function-name="points"/>
  <rejection class="QPolygon" function-name="point"/>
  <rejection class="QWidget" function-name="create"/>
  <rejection class="QWidget" function-name="find"/>
  <rejection class="QWidget" function-name="handle"/>
  <rejection class="QWidget" function-name="styleChange"/>
  <rejection class="QWidget" function-name="internalWinId"/>
  <rejection class="QWidgetItem" field-name="wid"/>
  <rejection class="QActionGroup" function-name="selected"/>
  <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
  <rejection class="*" enum-name="enum_1"/>
  <value-type name="QTransform">
    <enum-type name="TransformationType"/>
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f, %f, %f, %f" />
               <replace from="%REPR_ARGS"
                        to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="ddddddddd" />
              <replace from="%REDUCE_ARGS"
                       to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()" />
            </insert-template>
        </inject-code>
    </add-function>

    <modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <!-- ### This is just an overload to "map(qreal,qreal,qreal*,qreal*)const" and can be discarded in Python -->
    <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
    <!-- ### -->

    <modify-function signature="inverted(bool*)const">
      <modify-argument index="1">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="PyTuple"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_bool*"/>
      </inject-code>
    </modify-function>
    <add-function signature="quadToQuad(QPolygonF&amp;, QPolygonF&amp;)" return-type="PyObject*" static="true">
      <inject-code>
        QTransform _result;
        if (QTransform::quadToQuad(%1, %2, _result)) {
            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
        } else {
            Py_INCREF(Py_None);
            %PYARG_0 = Py_None;
        }
      </inject-code>
    </add-function>
    <add-function signature="quadToSquare(QPolygonF &amp;)" return-type="PyObject*" static="true">
      <inject-code>
        QTransform _result;
        if (QTransform::quadToSquare(%1, _result)) {
            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
        } else {
            Py_INCREF(Py_None);
            %PYARG_0 = Py_None;
        }
      </inject-code>
    </add-function>

    <add-function signature="squareToQuad(QPolygonF &amp;)" return-type="PyObject*" static="true">
      <inject-code>
        QTransform _result;
        if (QTransform::squareToQuad(%1, _result)) {
            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
        } else {
            Py_INCREF(Py_None);
            %PYARG_0 = Py_None;
        }
      </inject-code>
    </add-function>

  </value-type>
  <object-type name="QStyleOption" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
    <enum-type name="OptionType" extensible="yes"/>
    <enum-type name="StyleOptionType"/>
    <enum-type name="StyleOptionVersion"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="init(const QWidget*)" remove="all"/>
  </object-type>
  <object-type name="QStyleOptionGraphicsItem" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionSizeGrip" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionButton" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version">
      <enum-type name="ButtonFeature" flags="ButtonFeatures"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionComboBox" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionComplex" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionDockWidget" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionDockWidgetV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version">
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionFocusRect" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionFrame" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionFrameV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version">
      <enum-type name="FrameFeature" flags="FrameFeatures"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionFrameV3" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV3::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV3::Version">
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionGroupBox" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionHeader" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version">
      <enum-type name="SectionPosition"/>
      <enum-type name="SelectedPosition"/>
      <enum-type name="SortIndicator"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionMenuItem" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version">
      <enum-type name="CheckType"/>
      <enum-type name="MenuItemType"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionProgressBar" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionProgressBarV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionRubberBand" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionSlider" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionSpinBox" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTab" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version">
      <enum-type name="CornerWidget" flags="CornerWidgets"/>
      <enum-type name="SelectedPosition"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="TabPosition"/>
  </object-type>
  <object-type name="QStyleOptionTabV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version">
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTabV3" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV3::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV3::Version">
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTabBarBase" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTabBarBaseV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBaseV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBaseV2::Version">
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTabWidgetFrame" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionTitleBar" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionToolBar" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="ToolBarFeature" flags="ToolBarFeatures"/>
      <enum-type name="ToolBarPosition"/>
  </object-type>
  <object-type name="QStyleOptionToolBox" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleOptionToolBoxV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version">
      <enum-type name="SelectedPosition"/>
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="TabPosition"/>
  </object-type>
  <object-type name="QStyleOptionToolButton" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="ToolButtonFeature" flags="ToolButtonFeatures" />
  </object-type>
  <value-type name="QStyleOptionViewItem" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version">
      <enum-type name="Position"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </value-type>
  <value-type name="QStyleOptionViewItemV2" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version">
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="ViewItemFeature" flags="ViewItemFeatures"/>
  </value-type>
  <value-type name="QStyleOptionViewItemV3" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version">
      <enum-type name="StyleOptionVersion"/>
  </value-type>
  <value-type name="QStyleOptionViewItemV4" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version" >
      <enum-type name="StyleOptionVersion"/>
      <enum-type name="ViewItemPosition"/>
  </value-type>
  <value-type name="QTextFragment" />
  <value-type name="QBitmap" >
    <modify-function signature="fromData(QSize,const uchar*,QImage::Format)">
      <modify-argument index="2">
        <replace-type modified-type="PyBuffer"/>
      </modify-argument>
      <inject-code>
        uchar* buffer = (uchar*) Shiboken::Buffer::getPointer(%PYARG_2);
        QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
        %PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
      </inject-code>
    </modify-function>
  </value-type>
  <value-type name="QTextInlineObject" />
  <value-type name="QSizePolicy">
      <enum-type name="ControlType" flags="ControlTypes"/>
      <enum-type name="Policy"/>
      <enum-type name="PolicyFlag"/>
  </value-type>
  <value-type name="QTableWidgetSelectionRange"/>
  <value-type name="QTextDocumentFragment" />
  <value-type name="QTextOption">
      <enum-type name="Flag" flags="Flags"/>
      <enum-type name="TabType"/>
      <enum-type name="WrapMode"/>
      <value-type name="Tab"/>
  </value-type>
  <value-type name="QTextLine" >
    <enum-type name="CursorPosition"/>
    <enum-type name="Edge"/>
    <modify-function signature="cursorToX(int*,QTextLine::Edge)const" remove="all" />
    <modify-function signature="cursorToX(int,QTextLine::Edge)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <inject-code class="target" position="beginning">
        %BEGIN_ALLOW_THREADS
        %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%1, %2);
        %END_ALLOW_THREADS
        %PYARG_0 = PyTuple_New(2);
        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
        </inject-code>
    </modify-function>
    <modify-function signature="xToCursor(qreal,QTextLine::CursorPosition)const">
      <modify-argument index="2">
        <rename to="edge"/>
      </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QTextTableFormat" />
  <value-type name="QTextImageFormat" />
  <value-type name="QTextFrameFormat" >
    <enum-type name="BorderStyle"/>
    <enum-type name="Position"/>
    <modify-function signature="isValid()const" access="non-final"/>
  </value-type>
  <value-type name="QTextLength">
      <enum-type name="Type"/>
  </value-type>
  <value-type name="QItemSelectionRange" hash-function="qHash">
    <!--### Obsolete in 4.3-->
    <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/>
  </value-type>
  <value-type name="QPainterPath">
    <enum-type name="ElementType"/>
    <value-type name="Element">
      <modify-field name="x" write="false"/>
      <modify-field name="y" write="false"/>
      <modify-field name="type" write="false"/>
      <include file-name="QPainterPath" location="global"/>
    </value-type>
  </value-type>
  <value-type name="QPalette">
    <enum-type name="ColorGroup" />
    <enum-type name="ColorRole" />
    <!--### Obsolete in 4.3-->
    <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/>
    <modify-function signature="background()const" remove="all"/>
    <modify-function signature="foreground()const" remove="all"/>
    <modify-function signature="serialNumber()const" remove="all"/>
    <!--### End of obsolete section -->
  </value-type>
  <value-type name="QKeySequence">
    <enum-type name="SequenceFormat"/>
    <enum-type name="SequenceMatch"/>
    <enum-type name="StandardKey"/>

    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%i, %i, %i, %i" />
               <replace from="%REPR_ARGS"
                        to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="iiii" />
              <replace from="%REDUCE_ARGS" to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]" />
            </insert-template>
        </inject-code>
    </add-function>

    <modify-function signature="operator[](uint) const" remove="all"/>
    <add-function signature="__getitem__">
        <inject-code class="target" position="beginning">
            if (_i &lt; 0 || _i >= %CPPSELF.count()) {
                PyErr_SetString(PyExc_IndexError, "index out of bounds");
                return 0;
            }
            int item = (*%CPPSELF)[_i];
            return %CONVERTTOPYTHON[int](item);
        </inject-code>
    </add-function>

    <!-- ### Not necessary due the PySide QVariant conversion rules -->
    <modify-function signature="operator QVariant()const" remove="all"/>
    <!-- ### Obsolete -->
    <modify-function signature="operator int()const" remove="all"/>
    <modify-function signature="operator QString()const" remove="all"/>
    <!-- ### End of obsolete section -->
  </value-type>
  <value-type name="QPicture" >
    <modify-function signature="load(QIODevice*, const char*)" allow-thread="yes"/>
    <modify-function signature="load(const QString&amp;, const char*)" allow-thread="yes"/>
    <modify-function signature="save(QIODevice*, const char*)" allow-thread="yes"/>
    <modify-function signature="save(const QString&amp;, const char*)" allow-thread="yes"/>
    <!-- ### Obsolete in 4.3-->
    <modify-function signature="pictureFormat(QString)" remove="all" />
    <modify-function signature="inputFormatList()" remove="all"/>
    <modify-function signature="inputFormats()" remove="all"/>
    <modify-function signature="outputFormatList()" remove="all"/>
    <modify-function signature="outputFormats()" remove="all"/>
    <!-- ### End of obsolete section -->
    <!-- See bug 759 -->
    <modify-function signature="data() const">
        <modify-argument index="return">
            <replace-type modified-type="PyObject"/>
        </modify-argument>
        <inject-code>
            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());
        </inject-code>
    </modify-function>
    <modify-function signature="setData(const char*,uint)">
        <modify-argument index="1">
            <replace-type modified-type="PyBuffer"/>
            <conversion-rule class="target">
                PyObject* %out = Shiboken::Buffer::newObject(%in, size);
            </conversion-rule>
            <conversion-rule class="native">
                Py_ssize_t bufferLen;
                char* %out = (char*) Shiboken::Buffer::getPointer(%PYARG_1, &amp;bufferLen);
            </conversion-rule>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
            <conversion-rule class="native">
                uint %out = bufferLen;
            </conversion-rule>
        </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QRegion" >
    <enum-type name="RegionType"/>
    <!-- ### Obsolete in 4.3-->
    <modify-function signature="eor(QRegion)const" remove="all"/>
    <modify-function signature="intersect(QRect)const" remove="all" />
    <modify-function signature="intersect(QRegion)const" remove="all" />
    <modify-function signature="subtract(QRegion)const" remove="all"/>
    <modify-function signature="unite(QRegion)const" remove="all"/>
    <modify-function signature="unite(QRect)const" remove="all"/>
    <!-- ### End of obsolete section -->
    <!-- ### This operator does not make sense in Python. -->
    <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
    <modify-function signature="operator&amp;=(QRect)" remove="all"/>
    <!-- ### -->
  </value-type>
  <value-type name="QTextBlock">
    <value-type name="iterator" >
      <include file-name="QTextBlock" location="global"/>
      <!-- ### These operators where removed because they don't make sense in Python.
           The iterator methods (__iter__, next) replace this functionality. -->
      <modify-function signature="operator++()" remove="all"/>
      <modify-function signature="operator--()" remove="all"/>
      <!-- ### -->
      <add-function signature="__iter__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__iter__" />
        </inject-code>
      </add-function>
      <add-function signature="__next__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__next__">
            <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
          </insert-template>
        </inject-code>
      </add-function>
    </value-type>
    <add-function signature="__iter__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__iter_parent__">
            <replace from="%CPPSELF_TYPE" to="QTextBlock::iterator" />
          </insert-template>
        </inject-code>
    </add-function>
    <modify-function signature="setUserData(QTextBlockUserData*)">
        <inject-code class="target" position="end">
            const QTextDocument* doc = %CPPSELF.document();
            if (doc) {
                Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
                Shiboken::Object::setParent(pyDocument, %PYARG_1);
            }
        </inject-code>
    </modify-function>
    <modify-function signature="userData() const">
        <modify-argument index="return">
            <define-ownership class="target" owner="default"/>
        </modify-argument>
        <inject-code class="target" position="end">
            const QTextDocument* doc = %CPPSELF.document();
            if (doc) {
                Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
                Shiboken::Object::setParent(pyDocument, %PYARG_0);
            }
        </inject-code>
    </modify-function>
  </value-type>
  <value-type name="QTextBlockFormat">
    <enum-type name="LineHeightTypes" since="4.8" revision="4800"/>
  </value-type>
  <value-type name="QTextTableCellFormat" />
  <value-type name="QTextCharFormat" >
    <enum-type name="UnderlineStyle"/>
    <enum-type name="VerticalAlignment"/>
    <modify-function signature="isValid()const" access="non-final"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="anchorName()const" remove="all"/>
    <modify-function signature="setAnchorName(QString)" remove="all"/>
    <!--### End of obsolete section -->
  </value-type>
  <value-type name="QTextFormat" >
    <enum-type name="FormatType"/>
    <enum-type name="ObjectTypes"/>
    <enum-type name="PageBreakFlag" flags="PageBreakFlags"/>
    <enum-type name="Property" />
    <modify-function signature="isValid()const" access="non-final"/>
  </value-type>
  <value-type name="QTextListFormat">
      <enum-type name="Style"/>
  </value-type>
  <value-type name="QPolygon">
    <extra-includes>
      <include file-name="QMatrix" location="global"/>
      <include file-name="QTransform" location="global"/>
    </extra-includes>
    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            PyObject* points = PyList_New(%CPPSELF.count());
            for (int i = 0, max = %CPPSELF.count(); i &lt; max; ++i){
                int x, y;
                %CPPSELF.point(i, &amp;x, &amp;y);
                QPoint pt = QPoint(x, y);
                PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt));
            }
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="N" />
              <replace from="%REDUCE_ARGS" to="points" />
            </insert-template>
        </inject-code>
    </add-function>

    <!-- ### "QPolygon(int, const int*)" is an internal constructor. -->
    <modify-function signature="QPolygon(int, const int *)" remove="all"/>
    <!-- ### A QVector parameter, for no defined type, will generate wrong code. -->
    <modify-function signature="operator+=(QVector&lt;QPoint&gt;)" remove="all"/>
    <modify-function signature="operator&lt;&lt;(QPoint)">
        <inject-code>
            // %FUNCTION_NAME()
            *%CPPSELF &lt;&lt; %1;
            %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
        </inject-code>
    </modify-function>
    <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)">
        <inject-code>
            // %FUNCTION_NAME()
            *%CPPSELF &lt;&lt; %1;
            %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
        </inject-code>
    </modify-function>
    <!-- ### -->
  </value-type>
  <value-type name="QPolygonF">
    <extra-includes>
      <include file-name="QMatrix" location="global"/>
      <include file-name="QTransform" location="global"/>
    </extra-includes>
    <!-- ### A QVector parameter, for no defined type, will generate wrong code. -->
    <modify-function signature="operator+=(QVector&lt;QPointF&gt;)" remove="all"/>
    <!-- ### See bug 776 -->
    <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
    <!-- ### See bug 777 -->
    <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
    <!-- ### -->
  </value-type>
  <value-type name="QIcon" >
    <enum-type name="Mode"/>
    <enum-type name="State"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="serialNumber()const" remove="all"/>
    <modify-function signature="QIcon(QIconEngineV2 *)">
      <modify-argument index="1">
        <no-null-pointer/>
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QIcon(QIconEngine *)">
      <modify-argument index="1">
        <no-null-pointer/>
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QTreeWidgetItemIterator" >
    <modify-function signature="QTreeWidgetItemIterator(QTreeWidget *, QFlags&lt;QTreeWidgetItemIterator::IteratorFlag&gt;)">
        <modify-argument index="this">
            <parent index="1" action="add" />
        </modify-argument>
    </modify-function>

    <add-function signature="__iter__()" return-type="PyObject*">
      <inject-code class="target" position="beginning">
        <insert-template name="__iter__" />
      </inject-code>
    </add-function>
    <add-function signature="__next__()" return-type="PyObject*">
      <inject-code class="target" position="beginning">
      if (**%CPPSELF) {
          QTreeWidgetItemIterator* %0 = new QTreeWidgetItemIterator((*%CPPSELF)++);
          %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);
      }
      </inject-code>
    </add-function>

    <add-function signature="value()" return-type="QTreeWidgetItem*">
        <inject-code>
        QTreeWidgetItem* %0 = %CPPSELF.operator*();
        %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);
        Shiboken::Object::releaseOwnership(%PYARG_0);
        </inject-code>
    </add-function>
    <enum-type name="IteratorFlag" flags="IteratorFlags"/>
    <!-- ### See bug 778 -->
    <modify-function signature="operator++(int)" remove="all"/>
    <modify-function signature="operator--(int)" remove="all"/>
    <modify-function signature="operator++()" remove="all"/>
    <modify-function signature="operator--()" remove="all"/>
    <!-- ### Operator* doesn't make sense in Python. -->
    <modify-function signature="operator*()const" remove="all"/>
    <!-- ### -->
  </value-type>

  <template name="load_xpm">
        Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, "Invalid sequence."));
        int lineCount = PySequence_Fast_GET_SIZE(strList.object());
        for (int line = 0; line &lt; lineCount; ++line) {
            if (!Shiboken::String::check(PySequence_Fast_GET_ITEM(strList.object(), line))) {
                PyErr_SetString(PyExc_TypeError, "The argument must be a sequence of strings.");
                break;
            }
        }

        const char** xpm = (const char**) malloc (lineCount * sizeof(const char**));
        for (int line = 0; line &lt; lineCount; ++line)
            xpm[line] = Shiboken::String::toCString(PySequence_Fast_GET_ITEM(strList.object(), line));

        %BEGIN_ALLOW_THREADS
        %0 = new %TYPE(xpm);
        %END_ALLOW_THREADS

        free(xpm);
  </template>
  <value-type name="QPixmap" >
    <!--<conversion-rule>-->
        <!--<target-to-native replace="no">-->
            <!--<add-conversion type="QVariant" check="%CHECKTYPE[QVariant](%in)">-->
            <!--QVariant in = %CONVERTTOCPP[QVariant](%in);-->
            <!--%out = in.value&lt;%OUTTYPE&gt;();-->
            <!--</add-conversion>-->
        <!--</target-to-native>-->
    <!--</conversion-rule>-->
    <add-function signature="QPixmap(const QImage&amp;)">
        <modify-argument index="1">
            <rename to="image"/>
        </modify-argument>
        <inject-code class="target" position="beginning">
        %0 = new %TYPE(QPixmap::fromImage(%1));
        </inject-code>
    </add-function>
    <modify-function signature="QPixmap(const char **)">
        <modify-argument index="1">
            <replace-type modified-type="PySequence" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="load_xpm" />
        </inject-code>
    </modify-function>

    <!-- ### Operator ! doesn't make sense in Python. -->
    <modify-function signature="operator!()const" remove="all"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="serialNumber()const" remove="all"/>
    <!-- ### -->

    <modify-function signature="loadFromData(const uchar*,uint,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
      <modify-argument index="1">
        <replace-type modified-type="PyBytes"/>
        <conversion-rule class="native">
          const uchar* %out = reinterpret_cast&lt;const uchar*>(PyBytes_AS_STRING(%PYARG_1));
        </conversion-rule>
      </modify-argument>
      <modify-argument index="2">
        <remove-argument/>
        <conversion-rule class="native">
          uint %out = static_cast&lt;uint>(PyBytes_Size(%PYARG_1));
        </conversion-rule>
      </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QTextCursor" >
    <extra-includes>
      <include file-name="QTextBlock" location="global"/>
      <include file-name="QTextDocumentFragment" location="global"/>
    </extra-includes>
    <enum-type name="MoveMode"/>
    <enum-type name="MoveOperation"/>
    <enum-type name="SelectionType"/>
    <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
        <inject-code class="native" position="end">
            <insert-template name="fix_native_return_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="currentFrame()const">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTable(int,int,const QTextTableFormat &amp;)">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTable(int,int)">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
  </value-type>

  <value-type name="QItemSelection" />
  <value-type name="QMatrix">
    <extra-includes>
      <include file-name="QPainterPath" location="global"/>
    </extra-includes>
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f" />
               <replace from="%REPR_ARGS"
                        to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="dddddd" />
              <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()" />
            </insert-template>
        </inject-code>
    </add-function>
    <template name="qmatrix_map">
    %ARG1_TYPE a, b;
    %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;a, &amp;b);
    %PYARG_0 = PyTuple_New(2);
    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%ARG1_TYPE](a));
    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](b));
    </template>
    <modify-function signature="map(int,int,int*,int*)const">
        <modify-argument index="3">
            <remove-argument />
        </modify-argument>
        <modify-argument index="4">
            <remove-argument />
        </modify-argument>
        <inject-code>
            <insert-template name="qmatrix_map" />
        </inject-code>
    </modify-function>
    <modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
        <modify-argument index="3">
            <remove-argument />
        </modify-argument>
        <modify-argument index="4">
            <remove-argument />
        </modify-argument>
        <inject-code>
            <insert-template name="qmatrix_map" />
        </inject-code>
    </modify-function>
    <modify-function signature="inverted(bool*)const">
      <modify-argument index="1">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="PyTuple"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_bool*"/>
      </inject-code>
    </modify-function>
  </value-type>
  <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient" />
  <value-type name="QFontInfo" />
  <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient" />
  <value-type name="QFont" >
    <enum-type name="Capitalization"/>
    <enum-type name="SpacingType"/>
    <enum-type name="Stretch"/>
    <enum-type name="Style"/>
    <enum-type name="StyleHint" />
    <enum-type name="StyleStrategy"/>
    <enum-type name="Weight"/>
    <enum-type name="HintingPreference" since="4.8" revision="4800"/>
    <extra-includes>
      <include file-name="QStringList" location="global"/>
    </extra-includes>
    <modify-function signature="setStyleHint(QFont::StyleHint, QFont::StyleStrategy)">
      <modify-argument index="2">
        <rename to="strategy"/>
      </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QTextTableCell" >
    <extra-includes>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
  </value-type>
  <value-type name="QImage">
    <enum-type name="Format"/>
    <enum-type name="InvertMode"/>
    <extra-includes>
      <include file-name="QStringList" location="global"/>
      <include file-name="QMatrix" location="global"/>
    </extra-includes>

    <template name="qimage_buffer_constructor">
        uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1);
        %0 = new %TYPE(ptr, %ARGS);
    </template>
    <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)">
        <modify-argument index="1">
            <replace-type modified-type="PyBuffer"/>
        </modify-argument>
        <inject-code>
            <insert-template name="qimage_buffer_constructor">
                <replace from="%ARGS" to="%2, %3, %4, %5" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="QImage(uchar*,int,int,QImage::Format)">
        <modify-argument index="1">
            <replace-type modified-type="PyBuffer"/>
        </modify-argument>
        <inject-code>
            <insert-template name="qimage_buffer_constructor">
                <replace from="%ARGS" to="%2, %3, %4" />
            </insert-template>
        </inject-code>
    </modify-function>

    <add-function signature="QImage(QString&amp;,int,int,int,QImage::Format)">
        <inject-code>
            <insert-template name="qimage_buffer_constructor">
                <replace from="%ARGS" to="%2, %3, %4, %5" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QImage(QString&amp;,int,int,QImage::Format)">
        <inject-code>
            <insert-template name="qimage_buffer_constructor">
                <replace from="%ARGS" to="%2, %3, %4" />
            </insert-template>
        </inject-code>
    </add-function>

    <!-- The non-const versions are already used -->
    <modify-function signature="QImage(const uchar*,int,int,int,QImage::Format)" remove="all"/>
    <modify-function signature="QImage(const uchar*,int,int,QImage::Format)" remove="all" />
    <!-- ### -->

    <modify-function signature="QImage(const char**)">
        <modify-argument index="1">
            <replace-type modified-type="PySequence" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="load_xpm" />
        </inject-code>
    </modify-function>
    <!-- ### "QImage(const char*,const char*)" is just an overload for "QImage(QString,const char*)" -->
    <modify-function signature="QImage(const char*,const char*)" remove="all" />
    <!-- ### There is already an fromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
    <modify-function signature="fromData(const uchar*,int,const char*)" remove="all"/>
    <!-- ### There is already an loadFromData with a QByteArray type (that is convertible from Python's str) as the first type. -->
    <modify-function signature="loadFromData(const uchar*,int,const char*)" remove="all" />

    <!-- ### Functions removed because we already have overloads using QString -->
    <modify-function signature="setText(const char*,const char*,QString)" remove="all" />
    <modify-function signature="text(const char*,const char*)const" remove="all" />
    <!-- ### -->

    <!--### Obsolete in 4.3-->
    <modify-function signature="serialNumber()const" remove="all"/>
    <modify-function signature="textLanguages()const" remove="all"/>
    <!--### end of obsolete section -->

    <modify-function signature="constBits()const" since="4.7">
        <inject-code>
            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
        </inject-code>
    </modify-function>
    <modify-function signature="bits()">
        <inject-code>
            // byteCount() is only available on Qt4.7, so we use bytesPerLine * height
            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.bytesPerLine() * %CPPSELF.height(), Shiboken::Buffer::ReadWrite);
        </inject-code>
    </modify-function>
    <modify-function signature="constScanLine(int)const" since="4.7">
        <inject-code>
            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());
        </inject-code>
        <modify-argument index="return">
            <replace-type modified-type="PyObject" />
        </modify-argument>
    </modify-function>
    <modify-function signature="scanLine(int)">
        <inject-code>
            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);
        </inject-code>
        <modify-argument index="return">
            <replace-type modified-type="PyObject" />
        </modify-argument>
    </modify-function>
    <!--
        Only the non-const version of bits() and scanLine() is exported to Python
        If the user don't want to detach the QImage data he must use constBits or constScanLine
        as Python doesn't have the concept of constness.
    -->
    <modify-function signature="bits()const" remove="all"/>
    <modify-function signature="scanLine(int)const" remove="all"/>

    <modify-function signature="invertPixels(QImage::InvertMode)">
      <modify-argument index="1">
        <rename to="mode"/>
      </modify-argument>
    </modify-function>
  </value-type>
  <value-type name="QCursor" >
    <extra-includes>
      <include file-name="QPixmap" location="global"/>
      <include file-name="Qt" location="global"/>
    </extra-includes>
  </value-type>
  <value-type name="QFontDatabase" >
    <extra-includes>
      <include file-name="QStringList" location="global"/>
    </extra-includes>
    <enum-type name="WritingSystem" />
  </value-type>
  <value-type name="QPen">
    <extra-includes>
      <include file-name="QBrush" location="global"/>
    </extra-includes>
  </value-type>
  <value-type name="QBrush">
    <extra-includes>
      <include file-name="QPixmap" location="global"/>
    </extra-includes>
  </value-type>

  <template name="qcolor_repr">
      switch(%CPPSELF.spec()) {
        case QColor::Rgb:
        {
            qreal r, g, b, a;
            %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
            QString repr = QString().sprintf("PySide.QtGui.QColor.fromRgbF(%.6f, %.6f, %.6f, %.6f)", r, g, b, a);
            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
            break;
        }
        case QColor::Hsv:
        {
            qreal h, s, v, a;
            %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
            QString repr = QString().sprintf("PySide.QtGui.QColor.fromHsvF(%.6f, %.6f, %.6f, %.6f)", h, s, v, a);
            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
            break;
        }
        case QColor::Cmyk:
        {
            qreal c, m, y, k, a;
            %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
            QString repr = QString().sprintf("PySide.QtGui.QColor.fromCmykF(%.6f, %.6f, %.6f, %.6f, %.6f)", c, m, y, k, a);
            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
            break;
        }
        #if QT_VERSION >= 0x040600
        case QColor::Hsl:
        {
            qreal h, s, l, a;
            %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
            QString repr = QString().sprintf("PySide.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
            break;
        }
        #endif
        default:
        {
            %PYARG_0 = Shiboken::String::fromCString("PySide.QtGui.QColor()");
        }
     }
  </template>
  <value-type name="QColor">
    <enum-type name="Spec"/>
    <extra-includes>
      <include file-name="QVariant" location="global"/>
    </extra-includes>
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="qcolor_repr" />
        </inject-code>
    </add-function>
    <add-function signature="__str__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="qcolor_repr" />
        </inject-code>
    </add-function>
    <add-function signature="__setstate__(PyObject*)" return-type="PyObject">
        <inject-code>
            Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));
            PyObject* args = PyTuple_GET_ITEM(%1, 1);
            %PYARG_0 = PyObject_Call(func, args, NULL);
        </inject-code>
    </add-function>
    <add-function signature="__reduce__" return-type="PyObject">
        <inject-code class="target" position="beginning">
          switch(%CPPSELF.spec()) {
            case QColor::Rgb:
            {
                qreal r, g, b, a;
                %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
                %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setRgbF", (float)r, (float)g, (float)b, (float)a);
                break;
            }
            case QColor::Hsv:
            {
                qreal h, s, v, a;
                %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
                %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHsvF", (float)h, (float)s, (float)v, (float)a);
                break;
            }
            case QColor::Cmyk:
            {
                qreal c, m, y, k, a;
                %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
                %PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setCmykF", (float)c, (float)m, (float)y, (float)k, (float)a);
                break;
            }
            #if QT_VERSION >= 0x040600
            case QColor::Hsl:
            {
                qreal h, s, l, a;
                %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
                %PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHslF", (float)h, (float)s, (float)l, (float)a);
                break;
            }
            #endif
            default:
            {
                %PYARG_0 = Py_BuildValue("(N(O))", PyObject_Type(%PYSELF), Py_None);
            }
          }
        </inject-code>
    </add-function>

    <add-function signature="toTuple" return-type="PyObject">
        <inject-code class="target" position="beginning">
          switch(%CPPSELF.spec()) {
          case QColor::Rgb:
          {
                int r, g, b, a;
                %CPPSELF.getRgb(&amp;r, &amp;g, &amp;b, &amp;a);
                %PYARG_0 = Py_BuildValue("iiii", r, g, b, a);
                break;
          }
          case QColor::Hsv:
          {
                int h, s, v, a;
                %CPPSELF.getHsv(&amp;h, &amp;s, &amp;v, &amp;a);
                %PYARG_0 = Py_BuildValue("iiii", h, s, v, a);
                break;
          }
          case QColor::Cmyk:
          {
                int c, m, y, k, a;
                %CPPSELF.getCmyk(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
                %PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a);
                break;
          }
          case QColor::Hsl:
          {
                int h, s, l, a;
                %CPPSELF.getHsl(&amp;h, &amp;s, &amp;l, &amp;a);
                %PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
                break;
          }
          default:
          {
                %PYARG_0 = 0;
          }
        }
        </inject-code>
    </add-function>
    <!-- ### "QColor(QColor::Spec)" is an internal method. -->
    <modify-function signature="QColor(QColor::Spec)" remove="all"/>
    <!-- ### Constructor removed because we already have an overload using QString. -->
    <modify-function signature="QColor(const char*)" remove="all" />
    <!-- ### -->
    <add-function signature="QColor(QVariant)">
        <inject-code class="target" position="beginning">
        if (%1.type() == QVariant::Color)
            %0 = new %TYPE(%1.value&lt;QColor>());
        else
            PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor");
        </inject-code>
    </add-function>
    <!-- get* methods. Inject code -->
    <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="5">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>

        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="5">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>

        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getHsl(int*,int*,int*,int*)const" since="4.6">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getHslF(qreal*,qreal*,qreal*,qreal*)const" since="4.6">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getHsv(int*,int*,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getHsvF(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getRgb(int*,int*,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getRgbF(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="dark(int)const" remove="all"/>
    <modify-function signature="light(int)const" remove="all"/>
    <!--### End of obsolete section -->
  </value-type>
  <value-type name="QFontMetricsF" >

    <modify-function signature="boundingRect(QChar)const" rename="boundingRectChar">
      <modify-argument index="1">
        <replace-type modified-type="char"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="QFontCharFix"/>
     </inject-code>
    </modify-function>

    <modify-function signature="width(QChar)const" rename="widthChar">
      <modify-argument index="1">
        <replace-type modified-type="char"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="QFontCharFix"/>
     </inject-code>
    </modify-function>

    <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
      <modify-argument index="5">
          <replace-type modified-type="PyObject"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int* array = NULL;
        bool errorOccurred = false;

        if (numArgs == 5) {
            array = Shiboken::sequenceToIntArray(%PYARG_5, true);
            if (PyErr_Occurred()) {
                if (array)
                    delete []array;
                errorOccurred = true;
            }
        }

        if (!errorOccurred) {
            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);

            if (array)
                delete []array;

            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
        }
      </inject-code>
    </modify-function>

    <modify-function signature="size(int,QString,int,int*)const">
      <modify-argument index="4">
          <replace-type modified-type="PyObject"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int* array = NULL;
        bool errorOccurred = false;

        if (numArgs == 4) {
            array = Shiboken::sequenceToIntArray(%PYARG_4, true);
            if (PyErr_Occurred()) {
                if (array)
                    delete []array;
                errorOccurred = true;
            }
        }

        if (!errorOccurred) {
            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);

            if (array)
                delete []array;

            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
        }
      </inject-code>
    </modify-function>
  </value-type>
  <value-type name="QFontMetrics" >

    <modify-function signature="boundingRect(QChar)const" rename="boundingRectChar">
      <modify-argument index="1">
        <replace-type modified-type="char"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="QFontCharFix"/>
     </inject-code>
    </modify-function>

    <modify-function signature="width(QChar)const" rename="widthChar">
      <modify-argument index="1">
        <replace-type modified-type="char"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="QFontCharFix"/>
     </inject-code>
    </modify-function>

    <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
      <modify-argument index="8">
        <replace-type modified-type="PyObject"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int* array = NULL;
        bool errorOccurred = false;

        if (numArgs == 8) {
            array = Shiboken::sequenceToIntArray(%PYARG_8, true);
            if (PyErr_Occurred()) {
                if (array)
                    delete []array;
                errorOccurred = true;
            }
        }

        if (!errorOccurred) {
            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array);

            if (array)
                delete []array;

            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
        }
      </inject-code>
    </modify-function>

    <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
      <modify-argument index="5">
          <replace-type modified-type="PyObject"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int* array = NULL;
        bool errorOccurred = false;

        if (numArgs == 5) {
            array = Shiboken::sequenceToIntArray(%PYARG_5, true);
            if (PyErr_Occurred()) {
                if (array)
                    delete []array;
                errorOccurred = true;
            }
        }

        if (!errorOccurred) {
            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);

            if (array)
                delete []array;

            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
        }
      </inject-code>
    </modify-function>

    <modify-function signature="size(int,QString,int,int*)const">
      <modify-argument index="4">
          <replace-type modified-type="PyObject"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int* array = NULL;
        bool errorOccurred = false;

        if (numArgs == 4) {
            array = Shiboken::sequenceToIntArray(%PYARG_4, true);
            if (PyErr_Occurred()) {
                if (array)
                    delete []array;
                errorOccurred = true;
            }
        }

        if (!errorOccurred) {
            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);

            if (array)
                delete []array;

            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
        }

      </inject-code>
    </modify-function>
  </value-type>
  <value-type name="QGradient" force-abstract="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
      <enum-type name="CoordinateMode"/>
      <enum-type name="InterpolationMode"/>
      <enum-type name="Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
      <enum-type name="Type"/>
  </value-type>
  <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient" />
  <object-type name="QLayoutItem">

    <modify-function signature="widget()">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="layout()">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="spacerItem()">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>

  </object-type>
  <object-type name="QPaintDevice">
      <enum-type name="PaintDeviceMetric"/>
  </object-type>
  <object-type name="QGraphicsItem">
    <enum-type name="CacheMode"/>
    <enum-type name="Extension"/>
    <enum-type name="GraphicsItemChange"/>
    <enum-type name="GraphicsItemFlag" flags="GraphicsItemFlags"/>
    <enum-type name="PanelModality" since="4.6"/>
    <inject-code class="target" position="end">
        PyObject* userTypeConstant =  PyInt_FromLong(QGraphicsItem::UserType);
        PyDict_SetItemString(Sbk_QGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant);
    </inject-code>
    <modify-function signature="setParentItem(QGraphicsItem *)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <template name="scene_return_parenting">
    if (%0) {
        QObject* parent = %0->parent();
        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));
        Shiboken::Object::setParent(pyParent, %PYARG_0);
    }
    </template>
    <modify-function signature="scene() const">
        <inject-code position="end">
            <insert-template name="scene_return_parenting"/>
        </inject-code>
        <modify-argument index="this">
          <parent index="return" action="add"/>
        </modify-argument>
    </modify-function>

    <modify-function signature="parentItem() const">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
      <modify-argument index="this">
        <parent index="return" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="parentWidget() const">
        <modify-argument index="this">
          <parent index="return" action="add"/>
        </modify-argument>
        <modify-argument index="return">
          <define-ownership class="target" owner="default"/>
        </modify-argument>
    </modify-function>
    <!-- ### Obsolete -->
    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
    <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="focusInEvent(QFocusEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="focusOutEvent(QFocusEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="isBlockedByModalPanel(QGraphicsItem**)const" since="4.6">
      <modify-argument index="1">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="(retval, blockingPanel)"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
      QGraphicsItem *item_ = NULL;
      %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;item_);
      %PYARG_0 = PyTuple_New(2);
      PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
      PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
      </inject-code>
    </modify-function>
    <modify-function signature="itemTransform(const QGraphicsItem*,bool*)const">
        <modify-argument index="2">
            <remove-argument />
            <remove-default-expression />
        </modify-argument>
        <modify-argument index="return">
            <replace-type modified-type="(QTransform, bool ok)"/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,bool*" />
        </inject-code>
    </modify-function>
    <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="keyPressEvent(QKeyEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="sceneEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
      <modify-argument index="2" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="children()const" remove="all"/>
    <modify-function signature="matrix()const" remove="all"/>
    <modify-function signature="resetMatrix()" remove="all"/>
    <modify-function signature="sceneMatrix()const" remove="all"/>
    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
    <!--### End of obsolete section -->
    <!-- ### These methods are internal on Qt. -->
    <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
    <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
    <!-- ### -->
  </object-type>
  <object-type name="QAbstractGraphicsShapeItem"/>
  <object-type name="QAbstractItemView">
    <enum-type name="CursorAction"/>
    <enum-type name="DragDropMode"/>
    <enum-type name="DropIndicatorPosition"/>
    <enum-type name="EditTrigger" flags="EditTriggers"/>
    <enum-type name="ScrollHint"/>
    <enum-type name="ScrollMode"/>
    <enum-type name="SelectionBehavior"/>
    <enum-type name="SelectionMode"/>
    <enum-type name="State"/>
    <modify-function signature="setModel(QAbstractItemModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setSelectionModel(QItemSelectionModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="viewOptions()const">
      <modify-argument index="return">
        <replace-default-expression with="QStyleOptionViewItem()" />
      </modify-argument>
    </modify-function>
    <modify-function signature="model() const">
      <modify-argument index="return">
        <!-- Defining ownership as "default" avoids the object to be automatically
             set as parent of the returned pointer. -->
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="selectionModel() const">
      <modify-argument index="return">
        <!-- Defining ownership as "default" avoids the object to be automatically
             set as parent of the returned pointer. -->
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setIndexWidget(const QModelIndex &amp;, QWidget *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="horizontalStepsPerItem()const" remove="all"/>
    <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/>
    <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/>
    <modify-function signature="verticalStepsPerItem()const" remove="all"/>
    <!--### End of obsolete section -->
    <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
      <modify-argument index="3" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
      <modify-argument index="2" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QAbstractSlider">
    <enum-type name="SliderAction"/>
    <enum-type name="SliderChange"/>
  </object-type>
  <object-type name="QAbstractTextDocumentLayout">
    <value-type name="PaintContext" >
      <include file-name="QAbstractTextDocumentLayout" location="global"/>
    </value-type>
    <value-type name="Selection" />
    <modify-function signature="setPaintDevice(QPaintDevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QPyTextObject" />
  <object-type name="QActionGroup">
    <modify-function signature="addAction(QAction*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeAction(QAction*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QCDEStyle">
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QCheckBox"/>
  <object-type name="QCleanlooksStyle">
    <!--### Obsolete in 4.3-->
    <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/>
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QCommonStyle">
    <!--### Obsolete in 4.3-->
    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/>
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QDataWidgetMapper">
    <enum-type name="SubmitPolicy"/>
    <modify-function signature="addMapping(QWidget*,int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMapping(QWidget*,int,QByteArray)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeMapping(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setModel(QAbstractItemModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QDateEdit"/>
  <object-type name="QDesktopServices">
      <enum-type name="StandardLocation"/>
  </object-type>
  <object-type name="QDialog">
    <enum-type name="DialogCode"/>
    <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="extension()const" remove="all"/>
    <modify-function signature="orientation()const" remove="all"/>
    <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/>
    <modify-function signature="showExtension(bool)" remove="all"/>
    <modify-function signature="setExtension(QWidget*)" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QDialogButtonBox">
    <enum-type name="ButtonLayout"/>
    <enum-type name="ButtonRole"/>
    <enum-type name="StandardButton" flags="StandardButtons" />
    <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeButton(QAbstractButton*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QDirModel" polymorphic-id-expression="qobject_cast&lt;QDirModel*&gt;(%1)">
    <enum-type name="Roles"/>
    <!-- ### This reimplementation of "QObject::parent()" is used in C++ only
         when "using QObject::parent;" is not available. It's useless in Python. -->
    <modify-function signature="parent()const" remove="all"/>
    <modify-function signature="setIconProvider(QFileIconProvider*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QDoubleValidator">
      <enum-type name="Notation"/>
  </object-type>
  <object-type name="QFileIconProvider">
      <enum-type name="IconType"/>
  </object-type>
  <object-type name="QWizard">
    <enum-type name="WizardButton" />
    <enum-type name="WizardOption" flags="WizardOptions"/>
    <enum-type name="WizardPixmap"/>
    <enum-type name="WizardStyle"/>
    <modify-function signature="addPage(QWizardPage*)">
      <modify-argument index="1">
        <no-null-pointer/>
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QWizardPage">
    <modify-function signature="wizard()const">
      <modify-argument index="this">
        <parent index="return" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QFocusFrame">
    <modify-function signature="setWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QFontComboBox">
      <enum-type name="FontFilter" flags="FontFilters"/>
  </object-type>
  <object-type name="QFontDialog">
    <enum-type name="FontDialogOption" flags="FontDialogOptions"/>
    <modify-function signature="getFont(bool*,QWidget*)" allow-thread="yes">
        <modify-argument index="1">
            <remove-argument />
        </modify-argument>
        <modify-argument index="return">
            <replace-type modified-type="PyTuple" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_bool*,arg"/>
        </inject-code>
    </modify-function>
    <modify-function signature="getFont(bool*,QFont,QWidget*)" allow-thread="yes">
        <modify-argument index="1">
            <remove-argument />
        </modify-argument>
        <modify-argument index="return">
            <replace-type modified-type="PyTuple" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_bool*,arg,arg"/>
        </inject-code>
    </modify-function>
    <modify-function signature="getFont(bool*,QFont,QWidget*,QString)" allow-thread="yes">
        <modify-argument index="1">
            <remove-argument />
        </modify-argument>
        <modify-argument index="return">
            <replace-type modified-type="PyTuple" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_bool*,arg,arg,arg"/>
        </inject-code>
    </modify-function>
    <modify-function signature="getFont(bool*,QFont,QWidget*,QString,QFlags&lt;QFontDialog::FontDialogOption&gt;)">
        <modify-argument index="1">
            <remove-argument />
        </modify-argument>
        <modify-argument index="return">
            <replace-type modified-type="PyTuple" />
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_bool*,arg,arg,arg,arg"/>
        </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsEllipseItem">
  </object-type>
  <object-type name="QGraphicsItemAnimation">
    <modify-function signature="setItem(QGraphicsItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setTimeLine(QTimeLine*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <extra-includes>
      <include file-name="QPair" location="global"/>
    </extra-includes>
  </object-type>
  <object-type name="QGraphicsItemGroup"/>
  <object-type name="QGraphicsLineItem" />
  <object-type name="QGraphicsPathItem" />
  <object-type name="QGraphicsPixmapItem">
      <enum-type name="ShapeMode"/>
  </object-type>
  <object-type name="QGraphicsPolygonItem"/>
  <object-type name="QGraphicsRectItem" />
  <object-type name="QGraphicsSimpleTextItem" />
  <object-type name="QHBoxLayout"/>
  <object-type name="QHeaderView">
    <enum-type name="ResizeMode" />
    <modify-function signature="paintSection(QPainter*,QRect,int)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QIconEngine">
    <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QIconEngineV2">
    <enum-type name="IconEngineHook"/>
    <modify-function signature="read(QDataStream&amp;)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="write(QDataStream&amp;)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!-- ### This makes little sense in Python. Could be reassessed later. -->
    <modify-function signature="virtual_hook(int,void*)" remove="all"/>
  </object-type>
  <object-type name="QImageWriter">
    <enum-type name="ImageWriterError"/>
    <modify-function signature="setDevice(QIODevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="write(const QImage&amp;)" allow-thread="yes"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="description()const" remove="all"/>
    <modify-function signature="setDescription(QString)" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QInputContextFactory"/>
  <object-type name="QIntValidator" />
  <object-type name="QItemDelegate">
    <!-- ### "doLayout(...)" is an internal method. -->
    <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const" remove="all" />
    <!-- ### "selected(QPixmap,QPalette,bool)" is an internal method. -->
    <modify-function signature="selected(QPixmap,QPalette,bool)const" remove="all"/>
    <!-- ### -->
    <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QItemEditorCreatorBase">
    <modify-function signature="createWidget(QWidget *) const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QItemEditorFactory">
      <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
      <modify-argument index="2">
        <reference-count action="set"/>
      </modify-argument>
      <inject-code>
        Shiboken::Object::releaseOwnership(%PYARG_2);
      </inject-code>
    </modify-function>
    <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
      <modify-argument index="1">
        <define-ownership owner="c++"/>
      </modify-argument>
      <inject-code>
        //this function is static we need keep ref to default value, to be able to call python virtual functions
        static PyObject* _defaultValue = 0;
        %CPPSELF.%FUNCTION_NAME(%1);
        Py_INCREF(%PYARG_1);
        if (_defaultValue)
            Py_DECREF(_defaultValue);

        _defaultValue = %PYARG_1;
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QItemSelectionModel">
      <enum-type name="SelectionFlag" flags="SelectionFlags"/>
  </object-type>
  <object-type name="QListView">
      <enum-type name="Flow"/>
      <enum-type name="LayoutMode"/>
      <enum-type name="Movement"/>
      <enum-type name="ResizeMode"/>
      <enum-type name="ViewMode"/>
  </object-type>
  <object-type name="QColumnView">
    <modify-function signature="setPreviewWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QMainWindow">
    <enum-type name="DockOption" flags="DockOptions"/>
    <modify-function signature="setCentralWidget(QWidget*)">
       <inject-code class="target" position="beginning">
         <insert-template name="replace_child">
           <replace from="$FUNCTION_GET_OLD" to="centralWidget" />
           <replace from="$CHILD_TYPE" to="QWidget" />
           <replace from="$PYARG" to="%PYARG_1" />
           <replace from="$CPPARG" to="%1" />
         </insert-template>
       </inject-code>
    </modify-function>

    <modify-function signature="setMenuBar(QMenuBar*)">
       <inject-code class="target" position="beginning">
         <insert-template name="replace_child">
           <replace from="$FUNCTION_GET_OLD" to="menuBar" />
           <replace from="$CHILD_TYPE" to="QMenuBar" />
           <replace from="$PYARG" to="%PYARG_1" />
           <replace from="$CPPARG" to="%1" />
         </insert-template>
       </inject-code>
   </modify-function>

   <modify-function signature="setMenuWidget(QWidget*)">
       <inject-code class="target" position="beginning">
         <insert-template name="replace_child">
           <replace from="$FUNCTION_GET_OLD" to="menuWidget" />
           <replace from="$CHILD_TYPE" to="QWidget" />
           <replace from="$PYARG" to="%PYARG_1" />
           <replace from="$CPPARG" to="%1" />
         </insert-template>
       </inject-code>
    </modify-function>

    <modify-function signature="setStatusBar(QStatusBar*)">
       <inject-code class="target" position="beginning">
         <insert-template name="replace_child">
           <replace from="$FUNCTION_GET_OLD" to="statusBar" />
           <replace from="$CHILD_TYPE" to="QStatusBar" />
           <replace from="$PYARG" to="%PYARG_1" />
           <replace from="$CPPARG" to="%1" />
         </insert-template>
       </inject-code>
   </modify-function>

   <modify-function signature="addDockWidget(Qt::DockWidgetArea, QDockWidget*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!-- this fuction is declared when not defined QT_NO_TOOLBA -->
    <modify-function signature="addToolbar(Qt::ToolBarArea, QToolBar*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addToolbar(QToolBar*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addToolbar(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!--- END QT_NO_TOOLBAR -->
    <modify-function signature="removeDockWidget(QDockWidget*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeToolBar(QToolBar*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeDockWidget(QDockWidget*)">
      <modify-argument index="2">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>

  </object-type>
  <object-type name="QMdiArea">
    <enum-type name="AreaOption" flags="AreaOptions"/>
    <enum-type name="ViewMode"/>
    <enum-type name="WindowOrder"/>
    <modify-function signature="addSubWindow(QWidget*, QFlags&lt;Qt::WindowType&gt;)" >
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QMdiSubWindow">
    <enum-type name="SubWindowOption" flags="SubWindowOptions"/>
    <modify-function signature="setWidget(QWidget*)" >
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setSystemMenu(QMenu*)" >
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QMenu">
    <inject-code class="native" position="beginning" file="glue/qmenu_glue.cpp"/>

    <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
    <modify-function signature="exec(const QPoint&amp;, QAction*)" rename="exec_" allow-thread="yes" />
    <modify-function signature="exec(QList&lt;QAction*>, const QPoint&amp;, QAction*)" rename="exec_" allow-thread="yes" />
    <modify-function signature="exec(QList&lt;QAction*>, const QPoint&amp;, QAction*, QWidget*)" rename="exec_" allow-thread="yes" />
    <modify-function signature="addAction(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMenu(QMenu*)">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMenu(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMenu(const QIcon &amp;, const QString &amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertMenu(QAction*,QMenu*)">
      <modify-argument index="return">
        <parent index="2" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMenu(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addMenu(const QIcon &amp;, const QString &amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!-- ### "setNoReplayFor(QWidget*)" is an internal method. -->
    <modify-function signature="setNoReplayFor(QWidget*)" remove="all" />

    <add-function signature="addAction(QString&amp;, PyObject*, QKeySequence&amp;)">
      <modify-argument index="3">
        <replace-default-expression with="0" />
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>

      <inject-code class="target" position="beginning">
        %PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
      </inject-code>
    </add-function>

    <add-function signature="addAction(QIcon&amp;, QString&amp;, PyObject*, QKeySequence&amp;)">
      <modify-argument index="4">
        <replace-default-expression with="0" />
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>

      <inject-code class="target" position="beginning">
        %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);
      </inject-code>
    </add-function>

    <modify-function signature="clear()">
      <inject-code>
          Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
          PyObject* pyObj;
          foreach(QAction* act, %CPPSELF.actions()) {
            if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) {
                Py_INCREF(pyObj);
                Shiboken::Object::setParent(NULL, pyObj);
                Shiboken::Object::invalidate(pyObj);
                Py_DECREF(pyObj);
            }
          }
      </inject-code>
    </modify-function>

  </object-type>

  <object-type name="QMenuBar">
    <inject-code class="native" position="beginning" file="glue/qmenubar_glue.cpp"/>
    <modify-function signature="addAction(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addAction(QString,const QObject*,const char*)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <add-function signature="addAction(const QString&amp;, PyObject*)">
      <inject-code class="target" position="beginning">
        %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2);
      </inject-code>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </add-function>
    <modify-function signature="addMenu(QMenu*)">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addSeparator()">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertMenu(QAction*,QMenu*)">
      <modify-argument index="return">
        <parent index="2" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertSeparator(QAction*)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="clear()">
      <inject-code>
          foreach(QAction *act, %CPPSELF.actions()) {
            Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
            Shiboken::Object::setParent(NULL, pyAct);
            Shiboken::Object::invalidate(pyAct);
          }
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QMotifStyle">
    <!--### Obsolete in 4.3-->
    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/>
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QPainterPathStroker" copyable="false"/>
  <object-type name="QPictureIO">
    <modify-function signature="setIODevice(QIODevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QPixmapCache">
    <value-type name="Key"/>
    <add-function signature="find(QPixmapCache::Key&amp;)">
        <inject-code>
            QPixmap p;
            if (%CPPSELF.%FUNCTION_NAME(%1, &amp;p)) {
                %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);
            } else {
                %PYARG_0 = Py_None;
                Py_INCREF(%PYARG_0);
            }
        </inject-code>
    </add-function>
    <!-- ### Obsolete. -->
    <modify-function signature="find(QString,QPixmap&amp;)" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QPlastiqueStyle">
    <!--### Obsolete in 4.3-->
    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/>
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
    <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QProgressBar">
      <enum-type name="Direction"/>
  </object-type>
  <object-type name="QPushButton" />
  <object-type name="QRegExpValidator" />
  <object-type name="QScrollArea">
    <modify-function signature="setWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>

  <object-type name="QShortcut">
    <add-function signature="QShortcut(QKeySequence&amp;, QWidget*, PyCallable*, Qt::ShortcutContext)">
      <modify-argument index="4">
        <replace-default-expression with="Qt::WindowShortcut"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        %0 = new %TYPE(%1, %2);
      </inject-code>
      <inject-code class="target" position="end">
        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
        if (!result.isNull())
            Shiboken::Object::setParent(%PYARG_2, %PYSELF);
      </inject-code>
    </add-function>
  </object-type>
  <object-type name="QSound"/>
  <object-type name="QSpacerItem"/>
  <object-type name="QStandardItem">
    <enum-type name="ItemType"/>
    <modify-function signature="operator&lt;(QStandardItem)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="read(QDataStream&amp;)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="write(QDataStream&amp;)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>

    <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="appendRow(QStandardItem *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="appendRows(const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRows(int, const QList&lt;QStandardItem *&gt; &amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="setChild(int, int, QStandardItem *)">
      <inject-code class="target" position="beginning">
        // Clear parent from the old child
        QStandardItem* _i = %CPPSELF->child(%1, %2);
        if (_i) {
            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
            Shiboken::Object::setParent(0, _pyI);
        }
      </inject-code>
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setChild(int, QStandardItem *)">
      <inject-code class="target" position="beginning">
        // Clear parent from the old child
        QStandardItem* _i = %CPPSELF->child(%1);
        if (_i) {
            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
            Shiboken::Object::setParent(0, _pyI);
        }
      </inject-code>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

     <modify-function signature="takeChild(int, int)">
      <modify-argument index="return">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="clone() const">
      <modify-argument index="return">
        <define-ownership class="native" owner="c++"/>
        <define-ownership class="target" owner="target"/>
      </modify-argument>
    </modify-function>

    <!-- ??? -->
    <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
  </object-type>
  <object-type name="QStatusBar">
    <modify-function signature="addWidget(QWidget*, int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addPermanentWidget(QWidget*, int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertWidget(int, QWidget*, int)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertPermanentWidget(int, QWidget*, int)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QStringListModel"/>
  <object-type name="QStyleFactory">
    <modify-function signature="create(const QString&amp;)">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QStyleHintReturn">
      <enum-type name="HintReturnType"/>
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleHintReturnVariant">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStyleHintReturnMask">
      <enum-type name="StyleOptionType"/>
      <enum-type name="StyleOptionVersion"/>
  </object-type>
  <object-type name="QStylePainter" />
  <object-type name="QSyntaxHighlighter">
    <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
      <modify-argument index="1">
        <define-ownership class="target" owner="c++"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setDocument(QTextDocument*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="document() const">
      <modify-argument index="this">
        <parent index="return" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QTableView">
    <modify-function signature="setHorizontalHeader(QHeaderView*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setVerticalHeader(QHeaderView*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="sortByColumn(int)" remove="all"/>
  </object-type>
  <object-type name="QTextBlockGroup" />
  <object-type name="QTextBlockUserData" />
  <object-type name="QTextItem">
      <enum-type name="RenderFlag" flags="RenderFlags"/>
  </object-type>
  <object-type name="QTextList" >
    <!--### Obsolete in 4.3-->
    <modify-function signature="isEmpty()const" remove="all"/>
  </object-type>
  <object-type name="QTextObject"/>
  <object-type name="QTextObjectInterface" >
    <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QTimeEdit"/>
  <object-type name="QToolBox">
    <modify-function signature="addItem(QWidget*, const QIcon&amp;, const QString&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addItem(QWidget*, const QString&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertItem(int, QWidget*, const QIcon&amp;, const QString&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertItem(int, QWidget*, const QString&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeItem(int)">
      <inject-code class="target" position="beginning">
        QWidget *_widget = %CPPSELF.widget(%1);
        if (_widget) {
            Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
            Shiboken::Object::setParent(0, pyWidget);
        }
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QToolButton">
    <enum-type name="ToolButtonPopupMode"/>
    <modify-function signature="setDefaultAction(QAction *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setMenu(QMenu *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QToolTip"/>
  <object-type name="QTreeView">
    <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="sortByColumn(int)" remove="all"/>
  </object-type>
  <object-type name="QUndoCommand">
    <modify-function signature="mergeWith(const QUndoCommand*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QUndoGroup">
    <modify-function signature="addStack(QUndoStack*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeStack(QUndoStack*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QUndoStack">
    <modify-function signature="createUndoAction(QObject*, const QString&amp;)const">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="createRedoAction(QObject*, const QString&amp;)const">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="push(QUndoCommand*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QUndoView">
    <modify-function signature="setGroup(QUndoGroup *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setStack(QUndoStack *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QVBoxLayout"/>

  <template name="validator_conversionrule">
        QValidator::State %out;

        if (PySequence_Check(%PYARG_0)) {
            Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_0, 0));
            int size = PySequence_Fast_GET_SIZE(seq.object());

            if (size > 1) {
                if (%ISCONVERTIBLE[QString](PySequence_Fast_GET_ITEM(seq.object(), 1)))
                    %1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));
                else
                    qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.");
            }

            if (size > 2) {
                if (%ISCONVERTIBLE[int](PySequence_Fast_GET_ITEM(seq.object(), 2)))
                    %2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));
                else
                    qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.");
            }
            %PYARG_0 = PySequence_Fast_GET_ITEM(seq.object(), 0);
            Py_INCREF(%PYARG_0); // we need to incref, because "%PYARG_0 = ..." will decref the tuple and the tuple will be decrefed again at the end of this scope.
        }

        // check retrun value
        if (%ISCONVERTIBLE[QValidator::State](%PYARG_0)) {
            %out = %CONVERTTOCPP[QValidator::State](%PYARG_0);
        } else {
            PyErr_Format(PyExc_TypeError, "Invalid return value in function %s, expected %s, got %s.",
                        "QValidator.validate",
                        "PySide.QtGui.QValidator.State, (PySide.QtGui.QValidator.State,), (PySide.QtGui.QValidator.State, unicode) or (PySide.QtGui.QValidator.State, unicode, int)",
                        pyResult->ob_type->tp_name);
            return QValidator::State();
        }
  </template>

  <object-type name="QValidator">
    <enum-type name="State"/>
    <modify-function signature="fixup(QString &amp;)const">
      <modify-argument index="return">
        <replace-type modified-type="QString"/>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_QString"/>
      </inject-code>
    </modify-function>
    <modify-function signature="validate(QString &amp;, int &amp;)const">
      <modify-argument index="return">
        <replace-type modified-type="PyObject"/>
        <conversion-rule class="native">
            <insert-template name="validator_conversionrule"/>
        </conversion-rule>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_tuple_QValidator_QString_int"/>
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QWhatsThis"/>
  <object-type name="QWidgetAction">
    <modify-function signature="setDefaultWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="releaseWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QWidgetItem" polymorphic-id-expression="%1-&gt;widget()" />
  <object-type name="QWindowsStyle">
    <!--### Obsolete in 4.3-->
    <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/>
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
  </object-type>
  <object-type name="QWorkspace">
    <enum-type name="WindowOrder"/>
    <modify-function signature="addWindow(QWidget*, QFlags&lt;Qt::WindowType>)">
        <modify-argument index="1">
            <parent index="this" action="add" />
        </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged" />
  <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
  <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
  <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu">
      <enum-type name="Reason"/>
  </object-type>
  <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
  <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
  <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove" />
  <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
    <modify-function signature="source() const">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
    </modify-function>
    <!--### Method encodedData(const char*) exists only for Qt3 compatibility. -->
    <modify-function signature="encodedData(const char*)const" remove="all"/>
    <!--### Method format(int) exists only for Qt3 compatibility. -->
    <modify-function signature="format(int)const" remove="all"/>
    <!--### Method provides(const char*) exists only for Qt3 compatibility. -->
    <modify-function signature="provides(const char*)const" remove="all"/>
    <!-- ### -->
  </object-type>
  <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen" />
  <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut" />
  <object-type name="QGraphicsSceneContextMenuEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu">
      <enum-type name="Reason"/>
  </object-type>
  <object-type name="QGraphicsSceneDragDropEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop" >
    <!-- ### "setMimeData(const QMimeData*)" is an internal method. -->
    <modify-function signature="setMimeData(const QMimeData *)" remove="all"/>
    <!-- ### "setSource(QWidget*)" is an internal method. -->
    <modify-function signature="setSource(QWidget *)" remove="all"/>
    <!-- ### -->
  </object-type>
  <object-type name="QGraphicsSceneEvent" copyable="false">
    <!-- ### "setWidget(QWidget*)" is an internal method. -->
    <modify-function signature="setWidget(QWidget *)" remove="all"/>
  </object-type>
  <object-type name="QGraphicsSceneMoveEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove" />
  <object-type name="QGraphicsSceneResizeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize" />
  <object-type name="QGraphicsSceneHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp" />
  <object-type name="QGraphicsSceneHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove" />
  <object-type name="QGraphicsSceneMouseEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
  <object-type name="QGraphicsSceneWheelEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
  <object-type name="QHelpEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
  <object-type name="QHideEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
  <object-type name="QHoverEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
  <object-type name="QIconDragEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>

  <object-type name="QInputMethodEvent" copyable="no" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod">
    <!-- only declare this if ndef QT_NO_INPUTMETHOD -->
    <enum-type name="AttributeType"/>
    <value-type name="Attribute">
      <include file-name="QInputMethodEvent" location="global"/>
    </value-type>
    <!-- endif ndef QT_NO_INPUTMETHOD -->
  </object-type>

  <object-type name="QMoveEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Move" />
  <object-type name="QResizeEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
  <object-type name="QShortcutEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
    <!-- All these have const overloads that are used instead -->
    <modify-function signature="isAmbiguous()" remove="all"/>
    <modify-function signature="shortcutId()" remove="all"/>
    <modify-function signature="key()" remove="all"/>
    <!-- ### -->
  </object-type>
  <object-type name="QShowEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
  <object-type name="QStatusTipEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
  <object-type name="QTabletEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease">
      <enum-type name="PointerType"/>
      <enum-type name="TabletDevice"/>
  </object-type>
  <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
  <object-type name="QWhatsThisClickedEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
  <object-type name="QWheelEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
  <object-type name="QWindowStateChangeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
  <object-type name="QInputEvent" copyable="false">
    <modify-function signature="modifiers()const" access="non-final"/>
  </object-type>
  <object-type name="QKeyEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease || %1-&gt;type() == QEvent::ShortcutOverride">
      <add-function signature="operator!=(QKeySequence::StandardKey)">
          <inject-code class="target">
          bool ret = !(&amp;%CPPSELF == %1);
          %PYARG_0 = %CONVERTTOPYTHON[bool](ret);
          </inject-code>
      </add-function>
  </object-type>
  <object-type name="QMouseEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
  <object-type name="QPaintEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
  <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
  <object-type name="QGestureEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Gesture || %1-&gt;type() == QEvent::GestureOverride" since="4.6">
    <modify-function signature="activeGestures()const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="canceledGestures()const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="gestures()const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="gesture(Qt::GestureType)const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="widget()const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QAbstractButton"/>
  <object-type name="QStyle">
    <enum-type name="ComplexControl" extensible="yes"/>
    <enum-type name="ContentsType" extensible="yes"/>
    <enum-type name="ControlElement" extensible="yes"/>
    <enum-type name="PixelMetric" extensible="yes" />
    <enum-type name="PrimitiveElement" extensible="yes" />
    <enum-type name="RequestSoftwareInputPanel" since="4.6"/>
    <enum-type name="StandardPixmap" extensible="yes"/>
    <enum-type name="StateFlag" flags="State"/>
    <enum-type name="StyleHint" extensible="yes" />
    <enum-type name="SubControl" flags="SubControls" extensible="yes" force-integer="yes"/>
    <enum-type name="SubElement" extensible="yes" />
    <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
    <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
    <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
      <modify-argument index="3" invalidate-after-use="yes"/>
      <modify-argument index="4">
        <replace-default-expression with="0"/>
        <rename to="widget" />
      </modify-argument>
    </modify-function>
    <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
      <modify-argument index="3" invalidate-after-use="yes"/>
      <modify-argument index="4">
        <replace-default-expression with="0"/>
        <rename to="widget" />
      </modify-argument>
    </modify-function>
    <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
      <modify-argument index="3" invalidate-after-use="yes"/>
      <modify-argument index="4">
        <replace-default-expression with="0"/>
        <rename to="widget" />
      </modify-argument>
    </modify-function>
    <modify-function signature="hitTestComplexControl(QStyle::ComplexControl, const QStyleOptionComplex*, const QPoint&amp;, const QWidget*)const">
      <modify-argument index="4">
        <replace-default-expression with="0"/>
        <rename to="widget" />
      </modify-argument>
    </modify-function>
    <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
      <modify-argument index="4" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QColorDialog">
    <enum-type name="ColorDialogOption" flags="ColorDialogOptions"/>
    <!-- Obsolete method -->
    <modify-function signature="getRgba(uint,bool*,QWidget*)" remove="all" />
    <modify-function signature="getColor(const QColor&amp;, QWidget*)" allow-thread="yes" />
    <modify-function signature="getColor(const QColor&amp;, QWidget*, const QString&amp;, QFlags&lt;QColorDialog::ColorDialogOption>)" allow-thread="yes" />
  </object-type>
  <object-type name="QLayout">
    <inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>

    <enum-type name="SizeConstraint"/>

    <modify-function signature="itemAt(int)const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
      <inject-code class="target" position="end">
        addLayoutOwnership(%CPPSELF, %0);
      </inject-code>
    </modify-function>

    <modify-function signature="removeWidget(QWidget*)">
      <inject-code class="target" position="beginning">
        removeLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="removeItem(QLayoutItem*)">
      <inject-code class="target" position="beginning">
        removeLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>

    <modify-function signature="parentWidget()const">
      <modify-argument index="this">
        <parent index="return" action="add"/>
      </modify-argument>
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="takeAt(int)">
      <modify-argument index="return">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="addItem(QLayoutItem*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>

    <modify-function signature="addWidget(QWidget *)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addChildWidget(QWidget *)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addChildLayout(QLayout*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="setMenuBar(QWidget*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>

    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
        <inject-code class="native" position="end">
            <insert-template name="fix_native_return_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <!-- ### Obsolete in 4.3 -->
    <modify-function signature="setMargin(int)" remove="all"/>
    <modify-function signature="margin()const" remove="all"/>
    <!-- ### -->
  </object-type>

  <object-type name="QStackedLayout">
    <inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>
    <enum-type name="StackingMode"/>
    <modify-function signature="insertWidget(int,QWidget*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %2);
      </inject-code>
    </modify-function>
  </object-type>

  <object-type name="QBoxLayout">
    <inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>

    <enum-type name="Direction" />

    <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>

    <modify-function signature="addLayout(QLayout *, int)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>

    <modify-function signature="insertWidget(int, QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %2);
      </inject-code>
    </modify-function>
    <modify-function signature="insertLayout(int, QLayout *, int)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %2);
      </inject-code>
    </modify-function>
    <modify-function signature="insertItem(int, QLayoutItem *)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %2);
      </inject-code>
    </modify-function>
    <modify-function signature="addSpacerItem(QSpacerItem*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %2);
      </inject-code>
    </modify-function>
  </object-type>

  <object-type name="QGridLayout">
    <inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>
    <modify-function signature="itemAtPosition (int, int) const">
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
      <inject-code class="target" position="end">
        addLayoutOwnership(%CPPSELF, %0);
      </inject-code>
    </modify-function>
    <modify-function signature="addWidget(QWidget *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="4">
        <rename to="alignment"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addWidget(QWidget *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="6">
        <rename to="alignment"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="4">
        <rename to="alignment"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="6">
        <rename to="alignment"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="4">
        <rename to="rowSpan"/>
      </modify-argument>
      <modify-argument index="5">
        <rename to="columnSpan"/>
      </modify-argument>
      <modify-argument index="6">
        <rename to="alignment"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        addLayoutOwnership(%CPPSELF, %1);
      </inject-code>
    </modify-function>
    <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
        <modify-argument index="return">
            <replace-type modified-type="PyObject*" />
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="5">
            <remove-argument/>
            <remove-default-expression/>
        </modify-argument>
        <inject-code class="target" position="beginning">
        int a, b, c, d;
        %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);
        %PYARG_0 = PyTuple_New(4);
        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));
        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));
        PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));
        PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
        </inject-code>
    </modify-function>
  </object-type>

  <object-type name="QGraphicsView">
    <extra-includes>
      <include file-name="QPainterPath" location="global"/>
      <include file-name="QVarLengthArray" location="global"/>
    </extra-includes>
    <enum-type name="CacheModeFlag" flags="CacheMode"/>
    <enum-type name="DragMode"/>
    <enum-type name="OptimizationFlag" flags="OptimizationFlags"/>
    <enum-type name="ViewportAnchor"/>
    <enum-type name="ViewportUpdateMode"/>
    <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
    <modify-function signature="setScene(QGraphicsScene*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="scene()const">
        <inject-code position="end">
            <insert-template name="scene_return_parenting"/>
        </inject-code>
        <modify-argument index="return">
            <define-ownership owner="default"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="itemAt(int,int)const">
        <modify-argument index="return">
            <define-ownership owner="default"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="itemAt(QPoint)const">
        <modify-argument index="return">
            <define-ownership owner="default"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="drawBackground(QPainter*,QRectF)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawForeground(QPainter*,QRectF)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>

    <!-- TODO: Support conversions on virtual function -->
    <modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)">
        <modify-argument index="2">
            <remove-argument/>
            <conversion-rule class="native">
              int %out = PySequence_Size(%PYARG_1);
            </conversion-rule>
        </modify-argument>

        <modify-argument index="3">
            <replace-type modified-type="PySequence"/>
            <conversion-rule class="native">
                int numItems = PySequence_Size(%PYARG_1);
                Shiboken::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);
                for (int i=0; i &lt; numItems; i++) {
                    %out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
                }
            </conversion-rule>

            <conversion-rule class="target">
                Shiboken::AutoDecRef object(PyList_New(0));
                for (int i=0, max=numItems; i &lt; max; i++) {
                    PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i]));
                }
                PyObject *%out = object.object();
            </conversion-rule>
        </modify-argument>

        <modify-argument index="4">
            <replace-type modified-type="PySequence"/>
            <conversion-rule class="target">
                Shiboken::AutoDecRef option_object(PyList_New(0));
                for (int i=0, max=numItems; i &lt; max; i++) {
                    const QStyleOptionGraphicsItem* item = &amp;%in[i];
                    PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item));
                }
                PyObject* %out = option_object.object();
            </conversion-rule>

            <conversion-rule class="native">
                int numOptions = PySequence_Size(%PYARG_2);
                Shiboken::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);
                for (int i=0; i &lt; numOptions; i++) {
                    %out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
                }
            </conversion-rule>
        </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QInputDialog">
    <enum-type name="InputDialogOption"/>
    <enum-type name="InputMode"/>
    <modify-function signature="getInteger(QWidget*, const QString&amp;, const QString&amp;, int, int, int, int, bool*, QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
      <modify-argument index="8">
        <remove-default-expression/>
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getInt(QWidget*, const QString&amp;, const QString&amp;, int, int, int, int, bool*, QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
      <modify-argument index="8">
        <remove-default-expression/>
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getItem(QWidget*, const QString&amp;, const QString&amp;, const QStringList&amp;, int, bool, bool*, QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
      <modify-argument index="7">
        <remove-default-expression/>
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_arg,arg,arg,arg,arg,arg,bool*,arg"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getText(QWidget *, const QString&amp;, const QString&amp;, QLineEdit::EchoMode, const QString&amp;, bool*, QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
      <modify-argument index="6">
        <remove-default-expression/>
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_arg,arg,arg,arg,arg,bool*,arg"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getDouble(QWidget*, const QString&amp;, const QString&amp;, double, double, double, int, bool*, QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
      <modify-argument index="8">
        <remove-default-expression/>
        <remove-argument/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg"/>
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsScene">
    <extra-includes>
      <include file-name="QVarLengthArray" location="global"/>
    </extra-includes>
    <enum-type name="ItemIndexMethod"/>
    <enum-type name="SceneLayer" flags="SceneLayers"/>

    <!-- ### Obsolete -->
    <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)" remove="all" />
    <!-- ### -->

    <modify-function signature="createItemGroup(const QList&lt;QGraphicsItem*&gt;&amp;)">
        <modify-argument index="1">
            <parent index="return" action="add" />
        </modify-argument>
        <modify-argument index="return">
            <define-ownership owner="default"/>
        </modify-argument>
    </modify-function>

    <modify-function signature="destroyItemGroup(QGraphicsItemGroup*)">
        <inject-code>
        QGraphicsItem* parentItem = %1->parentItem();
        Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));
        foreach (QGraphicsItem* item, %1->children())
            Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));
        %BEGIN_ALLOW_THREADS
        %CPPSELF.%FUNCTION_NAME(%1);
        %END_ALLOW_THREADS
        // the arg was destroyed by Qt.
        Shiboken::Object::invalidate(%PYARG_1);
        </inject-code>
    </modify-function>

    <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawBackground(QPainter*,QRectF)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawForeground(QPainter*,QRectF)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="focusInEvent(QFocusEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="focusOutEvent(QFocusEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="keyPressEvent(QKeyEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="addItem(QGraphicsItem*)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
   </modify-function>

    <modify-function signature="addEllipse(const QRectF&amp;, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addEllipse(qreal, qreal, qreal, qreal, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="addLine(const QLineF&amp;, const QPen&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addLine(qreal, qreal, qreal, qreal, const QPen&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="addPath(const QPainterPath&amp;, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addPixmap(const QPixmap&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addPolygon(const QPolygonF&amp;, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addRect(const QRectF&amp;, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addRect(qreal, qreal, qreal, qreal, const QPen&amp;, const QBrush&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="addText(const QString&amp;, const QFont&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="addSimpleText(const QString&amp;, const QFont&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
        <!-- TODO: Add a keeper attribute to reference-count tag to do what this inject code do. -->
        <inject-code>
        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);
        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
        Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
        </inject-code>
    </modify-function>

    <!-- use glue code -->
    <modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*, QWidget *)">
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
    </modify-function>

    <modify-function signature="clear()">
        <inject-code>
            const QList&lt;QGraphicsItem*> items = %CPPSELF.items();
            Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
            foreach (QGraphicsItem* item, items) {
                SbkObject* obj = bm.retrieveWrapper(item);
                if (obj) {
                    if (reinterpret_cast&lt;PyObject*&gt;(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
                        Shiboken::Object::invalidate(obj);
                    Shiboken::Object::removeParent(obj);
                }
            }
            %CPPSELF.%FUNCTION_NAME();
        </inject-code>
    </modify-function>

    <modify-function signature="removeItem(QGraphicsItem*)">
      <modify-argument index="1">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>

    <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QCalendarWidget">
    <enum-type name="HorizontalHeaderFormat"/>
    <enum-type name="SelectionMode"/>
    <enum-type name="VerticalHeaderFormat"/>
    <extra-includes>
      <include file-name="QTextCharFormat" location="global"/>
    </extra-includes>
    <!--### Obsolete in 4.3-->
    <modify-function signature="isHeaderVisible()const" remove="all"/>
    <modify-function signature="setHeaderVisible(bool)" remove="all"/>
    <!--### End of obsolete section -->
    <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
      <modify-argument invalidate-after-use="yes" index="1"/>
    </modify-function>
  </object-type>
  <object-type name="QTreeWidget">
    <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!-- ### "indexOfTopLevelItem(QTreeWidgetItem*)" is an internal method. -->
    <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)" remove="all"/>
    <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addTopLevelItem(QTreeWidgetItem*)">
      <modify-argument index="1">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setHeaderItem(QTreeWidgetItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeTopLevelItem(int)">
      <modify-argument index="return">
        <define-ownership owner="default"/>
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="clear()">
        <inject-code>
        QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();
        Shiboken::BindingManager &amp;bm = Shiboken::BindingManager::instance();
        for (int i = 0; i &lt; rootItem->childCount(); ++i) {
            QTreeWidgetItem *item = rootItem->child(i);
            SbkObject* wrapper = bm.retrieveWrapper(item);
            if (wrapper)
                Shiboken::Object::setParent(0, reinterpret_cast&lt;PyObject*&gt;(wrapper));
        }
        </inject-code>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="items(const QMimeData*)const" remove="all"/>
  </object-type>
  <object-type name="QAbstractItemDelegate">
    <enum-type name="EndEditHint"/>
    <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/>
    <modify-function signature="createEditor(QWidget*,QStyleOptionViewItem,QModelIndex)const">
      <modify-argument index="1">
        <define-ownership owner="c++"/>
      </modify-argument>
      <modify-argument index="return">
        <define-ownership class="native" owner="c++"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QTableWidgetItem" >
    <enum-type name="ItemType"/>
    <!--### Obsolete in 4.3-->
    <modify-function signature="backgroundColor()const" remove="all"/>
    <modify-function signature="setBackgroundColor(QColor)" remove="all"/>
    <modify-function signature="setTextColor(QColor)" remove="all"/>
    <modify-function signature="textColor()const" remove="all"/>
    <!--### End of obsolete section -->
    <modify-function signature="read(QDataStream&amp;)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="write(QDataStream&amp;)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QListWidgetItem" >
    <enum-type name="ItemType"/>
    <modify-function signature="QListWidgetItem(const QString&amp;, QListWidget*, int)">
      <modify-argument index="this">
        <parent index="2" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QListWidgetItem(const QIcon&amp;, const QString&amp;, QListWidget*, int)">
      <modify-argument index="this">
        <parent index="3" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QListWidgetItem(QListWidget*, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="listWidget() const">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="read(QDataStream&amp;)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="write(QDataStream&amp;)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="backgroundColor()const" remove="all"/>
    <modify-function signature="setBackgroundColor(QColor)" remove="all"/>
    <modify-function signature="setTextColor(QColor)" remove="all"/>
    <modify-function signature="textColor()const" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QGraphicsTextItem">
    <!-- a QObject so main-thread delete redundant -->
    <extra-includes>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
    <modify-function signature="setDocument(QTextDocument*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QCompleter">
    <enum-type name="CompletionMode"/>
    <enum-type name="ModelSorting"/>
    <modify-function signature="setModel(QAbstractItemModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setPopup(QAbstractItemView*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setWidget(QWidget*)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QTreeWidgetItem" hash-function="qHash">
    <enum-type name="ChildIndicatorPolicy"/>
    <enum-type name="ItemType"/>
    <modify-function signature="read(QDataStream&amp;)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="write(QDataStream&amp;)const">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidget*, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidget*, const QStringList&amp;, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidget*, QTreeWidgetItem*, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem*, const QStringList &amp;, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QTreeWidgetItem(QTreeWidgetItem*, QTreeWidgetItem*, int)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addChild(QTreeWidgetItem *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertChild(int, QTreeWidgetItem *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeChild(QTreeWidgetItem*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeChild(int)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeChildren()">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="parent() const">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
      <inject-code class="target" position="end">
          // Only call the parent function if this return some value
          // the parent can be the TreeWidget
          if (%0)
            Shiboken::Object::setParent(%PYARG_0, %PYSELF);
      </inject-code>
    </modify-function>
    <modify-function signature="treeWidget() const">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
      <inject-code class="target" position="end">
          // Only call the parent function if this return some value
          // the parent can be the TreeWidgetItem
          if (%0)
            Shiboken::Object::setParent(%PYARG_0, %PYSELF);
      </inject-code>
    </modify-function>

    <!--### Obsolete in 4.3-->
    <modify-function signature="backgroundColor(int)const" remove="all"/>
    <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/>
    <modify-function signature="setTextColor(int, QColor)" remove="all"/>
    <modify-function signature="textColor(int)const" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QListWidget">
    <modify-function signature="setItemWidget(QListWidgetItem *, QWidget *)">
      <modify-argument index="2">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addItem(QListWidgetItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertItem(int, QListWidgetItem*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="setItemHidden(const QListWidgetItem*,bool)" remove="all"/>
    <modify-function signature="isItemHidden(const QListWidgetItem*)const" remove="all"/>
    <modify-function signature="setItemSelected(const QListWidgetItem*,bool)" remove="all"/>
    <modify-function signature="isItemSelected(const QListWidgetItem*)const" remove="all"/>
    <!--### End of obsolete section -->
    <modify-function signature="takeItem(int)">
      <modify-argument index="return">
        <define-ownership owner="default"/>
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QWidget">
    <extra-includes>
      <include file-name="QIcon" location="global"/>
      <include file-name="QMessageBox" location="global"/>
    </extra-includes>

    <inject-code class="native" file="glue/qwidget_glue.cpp" position="beginning" />

    <enum-type name="RenderFlag" flags="RenderFlags"/>

    <modify-function signature="setParent(QWidget*)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="setParent(QWidget*, QFlags&lt;Qt::WindowType&gt;)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="parentWidget()const">
        <modify-argument index="this">
          <parent index="return" action="add"/>
        </modify-argument>
        <modify-argument index="return">
          <define-ownership class="target" owner="default"/>
        </modify-argument>
    </modify-function>

    <modify-function signature="actionEvent(QActionEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="changeEvent(QEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="closeEvent(QCloseEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="dropEvent(QDropEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="enterEvent(QEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="focusInEvent(QFocusEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="focusOutEvent(QFocusEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="hideEvent(QHideEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="keyPressEvent(QKeyEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="keyReleaseEvent(QKeyEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="leaveEvent(QEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="mouseMoveEvent(QMouseEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="mousePressEvent(QMouseEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="moveEvent(QMoveEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="paintEvent(QPaintEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="resizeEvent(QResizeEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="showEvent(QShowEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="tabletEvent(QTabletEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>
    <modify-function signature="wheelEvent(QWheelEvent*)">
        <modify-argument index="1" invalidate-after-use="yes">
            <rename to="event"/>
        </modify-argument>
    </modify-function>

    <modify-function signature="setStyle(QStyle*)">
      <inject-code class="target" position="end">
        Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__",  %PYARG_1);
      </inject-code>
    </modify-function>
    <modify-function signature="style()const">
      <inject-code class="target" position="end">
        QStyle* myStyle = %CPPSELF->style();
        if (myStyle &amp;&amp; qApp) {
        %PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
            QStyle *appStyle = qApp->style();
            if (appStyle == myStyle) {
                Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
                Shiboken::Object::setParent(pyApp, %PYARG_0);
                Shiboken::Object::releaseOwnership(%PYARG_0);
            } else {
                Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__",  %PYARG_0);
            }
        }
      </inject-code>
      <modify-argument index="return">
        <define-ownership owner="default"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
      <modify-argument index="2">
        <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
        <remove-default-expression/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setFocusProxy(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setInputContext(QInputContext*)">
      <modify-argument index="1">
        <define-ownership owner="c++"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
        <inject-code class="native" position="end">
            <insert-template name="fix_native_return_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="insertAction(QAction*, QAction*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="setLayout(QLayout *)">
      <inject-code class="target" position="beginning">
        qwidgetSetLayout(%CPPSELF, %1);
        // %FUNCTION_NAME() - disable generation of function call.
      </inject-code>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="enabledChange(bool)" remove="all"/>
    <modify-function signature="fontChange(QFont)" remove="all"/>
    <modify-function signature="isEnabledToTLW()const" remove="all"/>
    <modify-function signature="isTopLevel()const" remove="all"/>
    <modify-function signature="paletteChange(QPalette)" remove="all"/>
    <modify-function signature="setShown(bool)" remove="all"/>
    <modify-function signature="topLevelWidget()const" remove="all"/>
    <modify-function signature="windowActivationChange(bool)" remove="all"/>
    <!--### End of obsolete section -->
    <modify-function signature="raise()" rename="raise_" />
    <modify-function signature="setParent(QWidget*, QFlags&lt;Qt::WindowType>)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="winId()const">
        <inject-documentation mode="replace" format="target">
            Returns the window system identifier of the widget.

            Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.

            If a widget is non-native (alien) and winId() is invoked on it, that widget will be provided a native handle.

            On X11 the type returned is long, on other platforms it's void pointer casted to a Python long long.

            This value may change at run-time. An event with type PySide.QtCore.QEvent.WinIdChange will be sent to the widget following a change in window system identifier.
        </inject-documentation>
    </modify-function>

    <modify-function signature="window()const">
      <modify-argument index="return">
        <define-ownership class="target" owner="default"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QMessageBox">
    <enum-type name="ButtonRole"/>
    <enum-type name="Icon"/>
    <enum-type name="StandardButton" flags="StandardButtons" />
    <modify-function signature="removeButton(QAbstractButton*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <extra-includes>
      <include file-name="QPixmap" location="global"/>
    </extra-includes>
    <!--### Obsolete in 4.3-->
    <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/>
    <modify-function signature="buttonText(int)const" remove="all"/>
    <modify-function signature="setButtonText(int, QString)" remove="all"/>
    <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/>
    <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/>
    <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/>
    <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/>
    <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/>
    <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/>
    <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/>
    <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/>
    <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/>
    <!--### End of obsolete section -->

    <modify-function signature="critical(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)" allow-thread="yes"/>
    <modify-function signature="information(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)" allow-thread="yes"/>
    <modify-function signature="question(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)" allow-thread="yes"/>
    <modify-function signature="warning(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)" allow-thread="yes"/>

  </object-type>
  <object-type name="QAbstractSpinBox">
    <enum-type name="ButtonSymbols"/>
    <enum-type name="CorrectionMode"/>
    <enum-type name="StepEnabledFlag" flags="StepEnabled"/>
    <modify-function signature="setLineEdit(QLineEdit *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="fixup(QString &amp;)const">
      <modify-argument index="return">
        <replace-type modified-type="QString"/>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_QString"/>
      </inject-code>
    </modify-function>
    <modify-function signature="validate(QString &amp;, int &amp;)const">
      <modify-argument index="return">
        <replace-type modified-type="PyObject"/>
        <conversion-rule class="native">
            <insert-template name="validator_conversionrule"/>
        </conversion-rule>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_tuple_QValidator_QString_int"/>
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QTextFrame" >
    <extra-includes>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
    <value-type name="iterator" >
      <include file-name="QTextFrame" location="global"/>
      <!-- ### These operators where removed because they don't make sense in Python.
           Instead iterator methods (__iter__, next) should be implemented.
           See bug 688 -->
      <modify-function signature="operator++()" remove="all"/>
      <modify-function signature="operator--()" remove="all"/>
      <!-- ### -->
      <add-function signature="__iter__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__iter__" />
        </inject-code>
      </add-function>
      <add-function signature="__next__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__next__">
            <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
          </insert-template>
        </inject-code>
      </add-function>
    </value-type>
    <add-function signature="__iter__()" return-type="PyObject*">
        <inject-code class="target" position="beginning">
          <insert-template name="__iter_parent__">
            <replace from="%CPPSELF_TYPE" to="QTextFrame::iterator" />
          </insert-template>
        </inject-code>
    </add-function>
  </object-type>
  <object-type name="QImageIOHandler">
    <extra-includes>
      <include file-name="QRect" location="global"/>
    </extra-includes>
    <enum-type name="ImageOption"/>
    <modify-function signature="setDevice(QIODevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="name()const" remove="all"/>
  </object-type>
  <object-type name="QProxyModel" polymorphic-id-expression="qobject_cast&lt;QProxyModel*&gt;(%1)">
    <!-- ### This reimplementation of "QObject::parent()" is used in C++ only
         when "using QObject::parent;" is not available. It's useless in Python. -->
    <modify-function signature="parent()const" remove="all"/>
    <extra-includes>
      <include file-name="QPixmap" location="global"/>
      <include file-name="QStringList" location="global"/>
      <include file-name="QSize" location="global"/>
    </extra-includes>
    <modify-function signature="setModel(QAbstractItemModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QImageReader">
    <extra-includes>
      <include file-name="QColor" location="global"/>
      <include file-name="QRect" location="global"/>
      <include file-name="QSize" location="global"/>
      <include file-name="QStringList" location="global"/>
      <include file-name="QImage" location="global"/>
    </extra-includes>
    <enum-type name="ImageReaderError"/>
    <!-- ### This method does not make sense in Python.
         Update: perhaps it does, but no one is missing it. -->
    <modify-function signature="read(QImage*)" remove="all" />
    <modify-function signature="setDevice(QIODevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QMovie">
    <extra-includes>
      <include file-name="QColor" location="global"/>
      <include file-name="QImage" location="global"/>
      <include file-name="QPixmap" location="global"/>
      <include file-name="QRect" location="global"/>
      <include file-name="QSize" location="global"/>
    </extra-includes>
    <enum-type name="CacheMode"/>
    <enum-type name="MovieState"/>
    <!-- ### "cacheMode()" is an internal method. -->
    <modify-function signature="cacheMode()" remove="all"/>
    <modify-function signature="setDevice(QIODevice*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QTabWidget">
    <enum-type name="TabPosition"/>
    <enum-type name="TabShape"/>
    <modify-function signature="addTab(QWidget*, const QString&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addTab(QWidget*, const QIcon&amp;, const QString&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTab(int, QWidget*, const QIcon&amp;, const QString&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertTab(int, QWidget*, const QString&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCornerWidget(QWidget*, Qt::Corner)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setTabBar(QTabBar*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

    <!-- This function need be re-implemented in inject code -->
    <modify-function signature="removeTab(int)">
    <inject-code class="target" position="beginning">
        QWidget* tab = %CPPSELF.widget(%1);
        if (tab) {
            Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
            %CPPSELF.%FUNCTION_NAME(%1);
        }
    </inject-code>
    </modify-function>
    <modify-function signature="clear()">
        <inject-code class="target" position="beginning">
            for (int i = 0; i &lt; %CPPSELF.count(); i++) {
                QWidget* widget = %CPPSELF.widget(i);
                Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
                Shiboken::Object::setParent(0, pyWidget);
            }
            %CPPSELF.%FUNCTION_NAME();
        </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QDrag">
    <extra-includes>
      <include file-name="QPoint" location="global"/>
      <include file-name="QPixmap" location="global"/>
    </extra-includes>
    <modify-function signature="QDrag(QWidget*)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="source() const">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="target() const">
      <modify-argument index="return">
        <define-ownership owner="target"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setMimeData(QMimeData*)">
      <modify-argument index="1">
        <!-- TODO: maybe this is not the best solution -->
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="exec(QFlags&lt;Qt::DropAction&gt;)" rename="exec_" allow-thread="yes"/>
    <modify-function signature="exec(QFlags&lt;Qt::DropAction&gt;, Qt::DropAction)" rename="exec_" allow-thread="yes"/>
  </object-type>
  <object-type name="QDateTimeEdit">
    <enum-type name="Section" flags="Sections"/>
    <modify-function signature="setCalendarWidget(QCalendarWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QSortFilterProxyModel">
    <!-- ### This reimplementation of "QObject::parent()" is used in C++ only
         when "using QObject::parent;" is not available. It's useless in Python. -->
    <modify-function signature="parent()const" remove="all"/>
    <extra-includes>
      <include file-name="QItemSelection" location="global"/>
      <include file-name="QStringList" location="global"/>
      <include file-name="QSize" location="global"/>
    </extra-includes>
    <modify-function signature="setSourceModel(QAbstractItemModel*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="clear()" remove="all"/>
    <modify-function signature="filterChanged()" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QSlider">
      <enum-type name="TickPosition" />
  </object-type>
  <object-type name="QInputContext">
    <extra-includes>
      <include file-name="QTextFormat" location="global"/>
    </extra-includes>
    <enum-type name="StandardFormat"/>
    <modify-function signature="filterEvent(const QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="mouseHandler(int,QMouseEvent*)">
      <modify-argument index="2" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QProgressDialog">
    <modify-function signature="setBar(QProgressBar*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setLabel(QLabel*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCancelButton(QPushButton*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QLabel">
    <modify-function signature="setBuddy(QWidget *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="setMovie(QMovie *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>


  <object-type name="QFileDialog">
    <enum-type name="AcceptMode"/>
    <enum-type name="DialogLabel"/>
    <enum-type name="FileMode"/>
    <enum-type name="Option" flags="Options"/>
    <enum-type name="ViewMode"/>
    <extra-includes>
      <include file-name="QUrl" location="global"/>
      <include file-name="QAbstractProxyModel" location="global"/>
    </extra-includes>
    <modify-function signature="setIconProvider(QFileIconProvider*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>

    <modify-function signature="getOpenFileNames(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)" allow-thread="yes">
      <modify-argument index="return">
        <replace-type modified-type="(fileNames, selectedFilter)"/>
      </modify-argument>
      <modify-argument index="5">
        <replace-type modified-type="QString"/>
        <replace-default-expression with="QString()"/>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_for_QFileDialog"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getOpenFileName(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)" allow-thread="yes">
      <modify-argument index="return">
        <replace-type modified-type="(fileName, selectedFilter)"/>
      </modify-argument>
      <modify-argument index="5">
        <replace-type modified-type="QString"/>
        <replace-default-expression with="QString()"/>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_for_QFileDialog"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getSaveFileName(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)" allow-thread="yes">
      <modify-argument index="return">
        <replace-type modified-type="(fileName, selectedFilter)"/>
      </modify-argument>
      <modify-argument index="5">
        <replace-type modified-type="QString"/>
        <replace-default-expression with="QString()"/>
      </modify-argument>
      <inject-code class="target" position="end">
        <insert-template name="return_for_QFileDialog"/>
      </inject-code>
    </modify-function>
    <modify-function signature="getExistingDirectory(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QFileDialog::Option>)" allow-thread="yes" />
  </object-type>
  <object-type name="QErrorMessage"/>
  <object-type name="QTabBar">
    <extra-includes>
      <include file-name="QIcon" location="global"/>
    </extra-includes>
    <enum-type name="Shape"/>
    <enum-type name="SelectionBehavior"/>
    <enum-type name="ButtonPosition"/>
  </object-type>
  <object-type name="QStandardItemModel" polymorphic-id-expression="qobject_cast&lt;QStandardItemModel*&gt;(%1)">
    <extra-includes>
      <include file-name="QStringList" location="global"/>
      <include file-name="QSize" location="global"/>
    </extra-includes>
    <modify-function signature="takeItem(int,int)">
      <modify-argument index="return">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>
    <modify-function signature="takeHorizontalHeaderItem(int)">
      <modify-argument index="return">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>
    <modify-function signature="takeVerticalHeaderItem(int)">
      <modify-argument index="return">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>
    <modify-function signature="verticalHeaderItem(int) const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="horizontalHeaderItem(int) const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="invisibleRootItem() const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="item(int, int) const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="itemFromIndex(const QModelIndex&amp;) const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="itemPrototype() const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="appendRow(const QList&lt;QStandardItem*&gt;&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="appendRow(QStandardItem*)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
  </modify-function>

    <modify-function signature="insertRow(int, QStandardItem*)">
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="setHorizontalHeaderItem(int, QStandardItem*)">
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="setItem(int, int, QStandardItem*)">
      <inject-code class="target" position="beginning">
        // Clear parent from the old child
        QStandardItem* _i = %CPPSELF->item(%1, %2);
        if (_i) {
            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
            Shiboken::Object::setParent(0, _pyI);
        }
      </inject-code>
      <modify-argument index="3">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="setItem(int, QStandardItem*)">
      <inject-code class="target" position="beginning">
        // Clear parent from the old child
        QStandardItem* _i = %CPPSELF->item(%1);
        if (_i) {
            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
            Shiboken::Object::setParent(0, _pyI);
        }
      </inject-code>
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemPrototype(const QStandardItem*)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="setVerticalHeaderItem(int, QStandardItem*)">
      <inject-code class="target" position="beginning">
        // Clear parent from the old child
        QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
        if (_i) {
            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
            Shiboken::Object::setParent(0, _pyI);
        }
      </inject-code>
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="takeColumn(int)">
      <modify-argument index="return">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>

    <modify-function signature="takeRow(int)">
      <modify-argument index="return">
        <parent index="this" action="remove" />
      </modify-argument>
    </modify-function>

    <modify-function signature="findItems(const QString&amp;, QFlags&lt;Qt::MatchFlag&gt;, int) const">
      <modify-argument index="return">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="insertColumn(int, const QList&lt;QStandardItem*&gt;&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="insertRow(int, const QList&lt;QStandardItem*&gt;&amp;)">
      <modify-argument index="2">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="appendColumn(const QList&lt;QStandardItem*&gt;&amp;)">
      <modify-argument index="1">
        <parent index="this" action="add" />
      </modify-argument>
    </modify-function>

    <modify-function signature="clear()">
        <inject-code class="target" position="beginning">
          Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
          SbkObject* pyRoot = bm.retrieveWrapper(%CPPSELF.invisibleRootItem());
          if (pyRoot) {
            Shiboken::Object::destroy(pyRoot, %CPPSELF.invisibleRootItem());
          }

          for(int r=0, r_max = %CPPSELF.rowCount(); r &lt; r_max; r++) {
            QList&lt;QStandardItem *&gt; ri = %CPPSELF.takeRow(0);

            PyObject *pyResult = %CONVERTTOPYTHON[QList&lt;QStandardItem * &gt;](ri);
            Shiboken::Object::setParent(Py_None, pyResult);
            Py_XDECREF(pyResult);
          }
        </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QRadioButton" />
  <object-type name="QScrollBar" />
  <object-type name="QClipboard">
    <extra-includes>
      <include file-name="QImage" location="global"/>
      <include file-name="QPixmap" location="global"/>
    </extra-includes>
    <enum-type name="Mode" />
    <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
      <modify-argument index="1">
        <!-- TODO: maybe this is not the best solution -->
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="text(QString&amp;,QClipboard::Mode)const">
      <modify-argument index="2">
        <replace-default-expression with="QClipboard::Clipboard"/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="(retval, subtype)"/>
      </modify-argument>
      <inject-code class="target" position="end">
      %BEGIN_ALLOW_THREADS
      %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
      %END_ALLOW_THREADS
      %PYARG_0 = PyTuple_New(2);
      PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
      PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QAbstractScrollArea">
    <modify-function signature="setViewport(QWidget *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCornerWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setVerticalScrollBar(QScrollBar*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setViewport(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setupViewport(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="viewportEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QPaintEngineState">
    <extra-includes>
      <include file-name="QPainterPath" location="global"/>
    </extra-includes>
  </object-type>
  <object-type name="QRubberBand">
    <enum-type name="Shape"/>
    <modify-function signature="QRubberBand(QRubberBand::Shape, QWidget*)">
      <modify-argument index="this">
        <parent index="2" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <rename to="parent"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QTextLayout">
    <extra-includes>
      <include file-name="QTextOption" location="global"/>
    </extra-includes>
    <enum-type name="CursorMode"/>
    <value-type name="FormatRange">
      <include file-name="QTextLayout" location="global"/>
    </value-type>
  </object-type>
  <object-type name="QTableWidget">
    <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItem(int, int, QTableWidgetItem *)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeHorizontalHeaderItem(int)">
      <modify-argument index="return">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeVerticalHeaderItem(int)">
      <modify-argument index="return">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="takeItem(int,int)">
      <modify-argument index="return">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCellWidget(int,int,QWidget*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCurrentItem(QTableWidgetItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <!-- ### Obsolete -->
    <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)" remove="all"/>
    <modify-function signature="isItemSelected(const QTableWidgetItem*)const" remove="all"/>
    <!-- ### -->
  </object-type>
  <object-type name="QTextDocument">
    <extra-includes>
      <include file-name="QTextBlock" location="global"/>
      <include file-name="QTextFormat" location="global"/>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
    <enum-type name="FindFlag" flags="FindFlags"/>
    <enum-type name="MetaInformation"/>
    <enum-type name="ResourceType"/>
    <enum-type name="Stacks" since="4.7"/>
    <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="object(int)const">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="objectForFormat(const QTextFormat&amp;)const">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="createObject(const QTextFormat&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="print(QPrinter*)const" rename="print_" />
  </object-type>
  <object-type name="QSplitter">
    <modify-function signature="getRange(int,int*,int*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="addWidget(QWidget *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertWidget(int, QWidget *)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QGroupBox" />
  <object-type name="QStackedWidget">
    <modify-function signature="addWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertWidget(int,QWidget*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setCurrentWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QSplitterHandle"/>
  <object-type name="QDial" />
  <object-type name="QLineEdit">
    <enum-type name="EchoMode"/>
    <modify-function signature="setCompleter(QCompleter*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setValidator(const QValidator*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="del()" rename="del_" />
    <modify-function signature="getTextMargins(int*, int*, int*, int*) const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject *" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="int" />
            </insert-template>
        </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QLCDNumber">
      <enum-type name="Mode"/>
      <enum-type name="SegmentStyle"/>
  </object-type>
  <object-type name="QSplashScreen">
    <!-- Override QWidget.painter -->
    <modify-function signature="repaint()" remove="all"/>
    <modify-function signature="drawContents(QPainter*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QDockWidget">
    <enum-type name="DockWidgetFeature" flags="DockWidgetFeatures"/>
    <modify-function signature="setTitleBarWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QAbstractProxyModel" polymorphic-id-expression="qobject_cast&lt;QAbstractProxyModel*&gt;(%1)">
    <extra-includes>
      <include file-name="QItemSelection" location="global"/>
      <include file-name="QStringList" location="global"/>
      <include file-name="QSize" location="global"/>
    </extra-includes>
    <modify-function signature="setSourceModel(QAbstractItemModel *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QDesktopWidget"/>
  <object-type name="QFrame">
      <enum-type name="Shadow" extensible="yes"/>
      <enum-type name="Shape"/>
      <enum-type name="StyleMask"/>
  </object-type>
  <object-type name="QTextTable">
    <extra-includes>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
  </object-type>
  <object-type name="QSpinBox">
      <modify-function signature="valueChanged(int)">
          <inject-documentation mode="append" format="target">
::

    def callback_int(value_as_int):
        print 'int value changed:', repr(value_as_int)

    app = QApplication(sys.argv)
    spinbox = QSpinBox()
    spinbox.valueChanged[unicode].connect(callback_unicode)
    spinbox.show()
    sys.exit(app.exec_())
          </inject-documentation>
      </modify-function>
      <modify-function signature="valueChanged(QString)">
          <inject-documentation mode="append" format="target">
::

    def callback_unicode(value_as_unicode):
        print 'unicode value changed:', repr(value_as_unicode)

    app = QApplication(sys.argv)
    spinbox = QSpinBox()
    spinbox.valueChanged[unicode].connect(callback_unicode)
    spinbox.show()
    sys.exit(app.exec_())
          </inject-documentation>
      </modify-function>
  </object-type>
  <object-type name="QTextBrowser"/>
  <object-type name="QDoubleSpinBox"/>
  <object-type name="QButtonGroup">
   <modify-function signature="addButton(QAbstractButton*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addButton(QAbstractButton*, int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeButton(QAbstractButton *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setId(QAbstractButton *,int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QToolBar">
    <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
      <modify-argument index="3">
        <replace-type modified-type="PyObject" />
      </modify-argument>
      <modify-argument index="4">
        <remove-argument />
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>

      <inject-code>
        QAction* action = %CPPSELF.addAction(%1, %2);
        %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_3));
      </inject-code>
    </modify-function>
    <modify-function signature="addAction(QString,const QObject*,const char*)">
      <modify-argument index="2">
        <replace-type modified-type="PyObject" />
      </modify-argument>
      <modify-argument index="3">
        <remove-argument />
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
      <inject-code>
        QAction* action = %CPPSELF.addAction(%1);
        %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_2));
      </inject-code>
    </modify-function>
    <modify-function signature="addAction(const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addAction(const QIcon&amp;, const QString&amp;)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addSeparator()">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addWidget(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertWidget(QAction*,QWidget*)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertSeparator(QAction*)">
      <modify-argument index="return">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="clear()">
      <inject-code>
        QList&lt;PyObject* &gt; lst;
        Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
        foreach(QToolButton* child, %CPPSELF.findChildren&lt;QToolButton*&gt;()) {
            if (bm.hasWrapper(child)) {
                PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
                Shiboken::Object::setParent(0, pyChild);
                lst &lt;&lt; pyChild;
            }
        }

        //Remove actions
        foreach(QAction *act, %CPPSELF.actions()) {
            Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
            Shiboken::Object::setParent(NULL, pyAct);
            Shiboken::Object::invalidate(pyAct);
        }

        %CPPSELF.clear();
        foreach(PyObject* obj, lst) {
            Shiboken::Object::invalidate(reinterpret_cast&lt;SbkObject* &gt;(obj));
            Py_XDECREF(obj);
        }
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QPaintEngine">
    <enum-type name="DirtyFlag" flags="DirtyFlags"/>
    <enum-type name="PaintEngineFeature" flags="PaintEngineFeatures"/>
    <enum-type name="PolygonDrawMode"/>
    <enum-type name="Type"/>
    <modify-function signature="begin(QPaintDevice*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="updateState(QPaintEngineState)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="drawTextItem(QPointF,QTextItem)">
      <modify-argument index="2" invalidate-after-use="yes"/>
    </modify-function>
    <extra-includes>
      <include file-name="QVarLengthArray" location="global"/>
    </extra-includes>
    <!-- ### "setPaintDevice(QPaintDevice*)" is an internal method. -->
    <modify-function signature="setPaintDevice(QPaintDevice*)" remove="all"/>
    <modify-field name="state" read="false" write="false"/>
  </object-type>
  <object-type name="QComboBox">
    <enum-type name="InsertPolicy"/>
    <enum-type name="SizeAdjustPolicy"/>
    <modify-function signature="setCompleter(QCompleter*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setValidator(const QValidator*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
      <modify-argument index="1">
        <reference-count action="set"/>
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setView(QAbstractItemView *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setLineEdit(QLineEdit *)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setModel(QAbstractItemModel *)">
      <modify-argument index="1">
        <no-null-pointer/>
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
    <!--### Obsolete in 4.3-->
    <modify-function signature="autoCompletion()const" remove="all"/>
    <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/>
    <modify-function signature="setAutoCompletion(bool)" remove="all"/>
    <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <object-type name="QTextEdit">
    <enum-type name="AutoFormattingFlag" flags="AutoFormatting"/>
    <enum-type name="LineWrapMode"/>
    <value-type name="ExtraSelection" >
      <include file-name="QTextEdit" location="global"/>
    </value-type>
    <extra-includes>
      <include file-name="QTextCursor" location="global"/>
    </extra-includes>
    <modify-function signature="setDocument(QTextDocument*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertFromMimeData(const QMimeData*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="print(QPrinter*) const" rename="print_"/>
  </object-type>
  <object-type name="QAction">
    <enum-type name="ActionEvent"/>
    <enum-type name="MenuRole"/>
    <enum-type name="Priority" since="4.6"/>
    <enum-type name="SoftKeyRole" since="4.6"/>
    <modify-function signature="setMenu(QMenu*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QPainter">
    <extra-includes>
      <include file-name="QWidget" location="global"/>
      <include file-name="QPainterPath" location="global"/>
      <include file-name="QPixmap" location="global"/>
    </extra-includes>
    <enum-type name="CompositionMode"/>
    <enum-type name="PixmapFragmentHint" flags="PixmapFragmentHints" since="4.7"/>
    <enum-type name="RenderHint" flags="RenderHints"/>
    <value-type name="PixmapFragment" since="4.7">
        <include file-name="QPainter" location="global"/>
    </value-type>

    <!-- ### "drawText(...)" is an internal method. -->
    <modify-function signature="drawText(const QPointF&amp;, const QString&amp;, int, int)" remove="all"/>

    <template name="qpainter_drawlist">
        %BEGIN_ALLOW_THREADS
        %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size());
        %END_ALLOW_THREADS
    </template>

    <modify-function signature="drawConvexPolygon(const QPoint*, int)" remove="all" />
    <add-function signature="drawConvexPolygon(QVector&lt;QPoint>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <modify-function signature="drawConvexPolygon(const QPointF*, int)" remove="all" />
    <add-function signature="drawConvexPolygon(QVector&lt;QPointF>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <!-- ### Overloads using QVector<T> does the job of these methods -->
    <modify-function signature="drawLines(const QLine*, int)" remove="all" />
    <modify-function signature="drawLines(const QLineF*, int)" remove="all" />
    <modify-function signature="drawLines(const QPoint*, int)" remove="all" />
    <modify-function signature="drawLines(const QPointF*, int)" remove="all" />
    <modify-function signature="drawRects(const QRect*, int)" remove="all" />
    <modify-function signature="drawRects(const QRectF*, int)" remove="all" />
    <!-- ### -->
    <modify-function signature="drawPoints(const QPoint*, int)" remove="all" />
    <add-function signature="drawPoints(QVector&lt;QPoint>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <modify-function signature="drawPoints(const QPointF*, int)" remove="all" />
    <add-function signature="drawPoints(QVector&lt;QPointF>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <modify-function signature="drawPolygon(const QPoint*, int, Qt::FillRule)" remove="all" />
    <add-function signature="drawPolygon(QVector&lt;QPoint>, Qt::FillRule)">
        <inject-code>
            %BEGIN_ALLOW_THREADS
            %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
            %END_ALLOW_THREADS
        </inject-code>
    </add-function>
    <modify-function signature="drawPolygon(const QPointF*, int, Qt::FillRule)" remove="all" />
    <add-function signature="drawPolygon(QVector&lt;QPointF>, Qt::FillRule)">
        <inject-code>
            %BEGIN_ALLOW_THREADS
            %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
            %END_ALLOW_THREADS
        </inject-code>
    </add-function>
    <modify-function signature="drawPolyline(const QPoint*, int)" remove="all" />
    <add-function signature="drawPolyline(QVector&lt;QPoint>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <modify-function signature="drawPolyline(const QPointF*, int)" remove="all" />
    <add-function signature="drawPolyline(QVector&lt;QPointF>)">
        <inject-code>
            <insert-template name="qpainter_drawlist" />
        </inject-code>
    </add-function>
    <modify-function signature="drawRoundRect(int, int, int, int, int, int)">
      <modify-argument index="5">
        <rename to="xRound"/>
      </modify-argument>
      <modify-argument index="6">
        <rename to="yRound"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="drawTiledPixmap(const QRect&amp;,const QPixmap&amp;, const QPoint&amp;)">
      <modify-argument index="3">
        <rename to="pos"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="QPainter(QPaintDevice*)">
      <modify-argument index="1">
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="begin(QPaintDevice*)">
      <modify-argument index="1">
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="initFrom(const QWidget*)">
      <modify-argument index="1">
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setRedirected(const QPaintDevice*, QPaintDevice*, const QPoint&amp;)">
      <modify-argument index="1">
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="restoreRedirected(const QPaintDevice*)">
      <modify-argument index="1">
        <no-null-pointer/>
      </modify-argument>
    </modify-function>
    <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
      <modify-argument index="4">
        <remove-argument/>
        <remove-default-expression/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="QRectF"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_args,QRectF*"/>
      </inject-code>
    </modify-function>
    <modify-function signature="drawText(QRect,int,QString,QRect*)">
      <modify-argument index="4">
        <remove-argument/>
        <remove-default-expression/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="QRect"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_args,QRect*"/>
      </inject-code>
    </modify-function>
    <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
      <modify-argument index="7">
        <remove-argument/>
        <remove-default-expression/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_args,QRect*"/>
      </inject-code>
    </modify-function>
    <!--### Obsoleted by QWidget::render() -->
    <modify-function signature="redirected(const QPaintDevice*,QPoint*)" remove="all" />
    <!--### Obsolete in 4.3-->
    <modify-function signature="matrix()const" remove="all"/>
    <modify-function signature="matrixEnabled()const" remove="all"/>
    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
    <modify-function signature="setMatrixEnabled(bool)" remove="all"/>
    <!--### End of obsolete section -->
  </object-type>
  <!-- qApp macro -->
  <inject-code class="native" position="beginning">
    PyObject* moduleQtGui;
  </inject-code>
  <inject-code class="target" file="glue/qtgui_qapp.cpp" position="end" />
  <object-type name="QApplication">
    <enum-type name="ColorSpec"/>
    <enum-type name="Type"/>
    <extra-includes>
      <include file-name="QBasicTimer" location="global"/>
      <include file-name="QFont" location="global"/>
      <include file-name="QFontMetrics" location="global"/>
      <include file-name="QPalette" location="global"/>
      <include file-name="QIcon" location="global"/>
      <include file-name="QLocale" location="global"/>
      <include file-name="QStyle" location="global"/>
    </extra-includes>
    <modify-function signature="QApplication(int&amp;,char**)" access="private" />
    <add-function signature="QApplication(PySequence)">
        <inject-code>
            QApplicationConstructor(%PYSELF, %1, &amp;%0);
        </inject-code>
    </add-function>
    <modify-function signature="QApplication(int&amp;,char**,bool)" access="private"/>
    <add-function signature="QApplication(PySequence,bool)">
        <inject-code>
            QApplicationConstructor(%PYSELF, %1, %2, &amp;%0);
        </inject-code>
    </add-function>
    <modify-function signature="QApplication(int&amp;,char**,QApplication::Type)" access="private" />
    <add-function signature="QApplication(PySequence,QApplication::Type)">
        <inject-code>
            QApplicationConstructor(%PYSELF, %1, %2, &amp;%0);
        </inject-code>
    </add-function>
    <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
    <inject-code class="native" file="glue/qapplication_init.cpp" position="beginning" />

    <!-- ### Causes warnings using generator. They were kept here to avoid generation even
         removing Q_INTERNAL_QAPP_SRC || qdoc from #define section-->
    <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
    <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
    <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
    <!-- ### -->

    <!-- ownership control transfer to qApp -->
    <modify-function signature="setStyle(QStyle*)">
        <inject-code class="target" position="end">
            Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
        </inject-code>
    </modify-function>
    <modify-function signature="style()">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="desktop()">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="clipboard()">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="focusWidget()">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="overrideCursor()">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="topLevelAt(const QPoint&amp;)">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="topLevelAt(int, int)">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="widgetAt(const QPoint&amp;)">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
    <modify-function signature="widgetAt(int, int)">
      <inject-code class="target" position="end">
        <insert-template name="set_qapp_parent_for_orphan"/>
      </inject-code>
    </modify-function>
  </object-type>
  <object-type name="QCommandLinkButton"/>
  <object-type name="QFileSystemModel" polymorphic-id-expression="qobject_cast&lt;QFileSystemModel*&gt;(%1)">
    <enum-type name="Roles"/>
    <modify-function signature="setIconProvider(QFileIconProvider*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QFormLayout">
    <inject-code class="native" position="beginning" file="glue/qlayout_help_functions.cpp"/>

    <enum-type name="FieldGrowthPolicy"/>
    <enum-type name="ItemRole"/>
    <enum-type name="RowWrapPolicy"/>

    <template name="fix_args,int*,ItemRole*">
    int _row;
    QFormLayout::ItemRole _role;
    %BEGIN_ALLOW_THREADS
    %CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_row, &amp;_role);
    %END_ALLOW_THREADS
    %PYARG_0 = PyTuple_New(2);
    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](_row));
    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role));
    </template>

    <modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,int*,ItemRole*"/>
        </inject-code>
    </modify-function>
    <modify-function signature="getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,int*,ItemRole*"/>
        </inject-code>
    </modify-function>
    <modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_args,int*,ItemRole*"/>
        </inject-code>
    </modify-function>

    <modify-function signature="addRow(QWidget*,QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addRow(QLayout*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addRow(QWidget*,QLayout*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addRow(QWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addRow(QString,QLayout*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addRow(QString,QWidget*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QLayout*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QWidget*,QLayout*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QWidget*,QWidget*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QWidget*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QString,QLayout*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertRow(int,QString,QWidget*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)">
      <modify-argument index="3">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsGridLayout" >
    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsLayout">
    <modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
        <inject-code class="native" position="end">
            <insert-template name="fix_native_return_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="widgetEvent(QEvent*)">
        <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsLayoutItem" copyable="false">
    <modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
        <inject-code class="native" position="end">
            <insert-template name="fix_native_return_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsLinearLayout" >
    <modify-function signature="addItem(QGraphicsLayoutItem*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="removeItem(QGraphicsLayoutItem*)">
      <modify-argument index="1">
        <parent index="this" action="remove"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QGraphicsProxyWidget">
    <modify-function signature="QGraphicsProxyWidget(QGraphicsItem*, QFlags&lt;Qt::WindowType&gt;)">
      <modify-argument index="this">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="createProxyForChildWidget(QWidget*)">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="newProxyWidget(const QWidget*)">
      <modify-argument index="return">
        <parent index="1" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setWidget(QWidget*)">
      <inject-code>
          QWidget* _old = %CPPSELF.widget();
          if (_old)
             Shiboken::Object::setParent(NULL, %CONVERTTOPYTHON[QWidget*](_old));
          %CPPSELF.%FUNCTION_NAME(%1);
          Shiboken::Object::setParent(%PYSELF, %PYARG_1);
      </inject-code>
    </modify-function>
  </object-type>
  <!-- a QObject so main-thread delete redundant -->
  <object-type name="QGraphicsWidget">
    <modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="return">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>

        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="getWindowFrameMargins(qreal*,qreal*,qreal*,qreal*)const">
        <modify-argument index="return">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>

        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <!-- a QObject so main-thread delete redundant -->
    <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
    <modify-function signature="children()const" remove="all"/>
    <modify-function signature="setLayout(QGraphicsLayout*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="changeEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="closeEvent(QCloseEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="grabKeyboardEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="grabMouseEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="hideEvent(QHideEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="showEvent(QShowEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="ungrabKeyboardEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="ungrabMouseEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="windowFrameEvent(QEvent*)">
      <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="setStyle(QStyle*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
  </object-type>
  <object-type name="QPlainTextDocumentLayout"/>
  <object-type name="QPlainTextEdit">
    <enum-type name="LineWrapMode"/>
    <modify-function signature="setDocument(QTextDocument*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="insertFromMimeData(const QMimeData*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="print(QPrinter*)const" rename="print_" />
  </object-type>
  <object-type name="QStyledItemDelegate">
    <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
  </object-type>

  <value-type name="QMatrix2x2" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="4" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="4" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix2x2(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="4" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="4" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="4" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix2x2" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix2x2&amp;)" return-type="bool" />

    <template name="inplace_add">
    *%CPPSELF += %1;
    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
    </template>
    <template name="inplace_sub">
    *%CPPSELF -= %1;
    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
    </template>
    <template name="inplace_mult">
    *%CPPSELF *= %1;
    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
    </template>
    <template name="inplace_div">
    *%CPPSELF /= %1;
    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
    </template>

    <add-function signature="operator*=(qreal)" return-type="QMatrix2x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix2x2&amp;)" return-type="QMatrix2x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix2x2&amp;)" return-type="QMatrix2x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix2x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix2x2&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix2x3" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="6" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="6" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix2x3(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix3x2" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix2x3&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix2x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix2x3&amp;)" return-type="QMatrix2x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix2x3&amp;)" return-type="QMatrix2x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix2x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix2x3&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix2x4" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="8" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="8" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix2x4(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix4x2" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix2x4&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix2x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix2x4&amp;)" return-type="QMatrix2x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix2x4&amp;)" return-type="QMatrix2x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix2x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix2x4&amp;)" return-type="bool" />
 </value-type>

  <value-type name="QMatrix3x2" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="6" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="6" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix3x2(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="6" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix2x3" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix3x2&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix3x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix3x2&amp;)" return-type="QMatrix3x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix3x2&amp;)" return-type="QMatrix3x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix3x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix3x2&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix3x3" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="9" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="9" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix3x3(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="9" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="9" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="9" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix3x3" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix3x3&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix3x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix3x3&amp;)" return-type="QMatrix3x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix3x3&amp;)" return-type="QMatrix3x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix3x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix3x3&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix3x4" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="12" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="12" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix3x4(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix4x3" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix3x4&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix3x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix3x4&amp;)" return-type="QMatrix3x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix3x4&amp;)" return-type="QMatrix3x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix3x4" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix3x4&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix4x2" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="8" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="8" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix4x2(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="8" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix2x4" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix4x2&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix4x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix4x2&amp;)" return-type="QMatrix4x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix4x2&amp;)" return-type="QMatrix4x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix4x2" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix4x2&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix4x3" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="12" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="12" />
            </insert-template>
        </inject-code>
    </add-function>
    <add-function signature="QMatrix4x3(PySequence*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_constructor">
          <replace from="%SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="data()" return-type="qreal">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="fill(PyObject*)">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_fill_function">
          <replace from="%MATRIX_SIZE" to="12" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="transposed()" return-type="PyObject">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_transposed_function">
          <replace from="%TRANSPOSED_TYPE" to="QMatrix3x4" />
        </insert-template>
      </inject-code>
    </add-function>
    <add-function signature="operator!=(const QMatrix4x3&amp;)" return-type="bool" />
    <add-function signature="operator*=(qreal)" return-type="QMatrix4x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_mult"/>
      </inject-code>
    </add-function>
    <add-function signature="operator+=(const QMatrix4x3&amp;)" return-type="QMatrix4x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_add"/>
      </inject-code>
    </add-function>
    <add-function signature="operator-=(const QMatrix4x3&amp;)" return-type="QMatrix4x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_sub"/>
      </inject-code>
    </add-function>
    <add-function signature="operator/=(qreal)" return-type="QMatrix4x3" >
      <inject-code class="target" position="beginning">
        <insert-template name="inplace_div"/>
      </inject-code>
    </add-function>
    <add-function signature="operator==(const QMatrix4x3&amp;)" return-type="bool" />
  </value-type>

  <value-type name="QMatrix4x4" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code_matrix">
               <replace from="%MATRIX_SIZE" to="16" />
               <replace from="%MATRIX_TYPE" to="qreal" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code_matrix">
              <replace from="%MATRIX_TYPE" to="qreal" />
              <replace from="%MATRIX_SIZE" to="16" />
            </insert-template>
        </inject-code>
    </add-function>

    <!-- ### "QMatrix4x4(const qreal*,int,int)" is an internal constructor. -->
    <modify-function signature="QMatrix4x4(const qreal*,int,int)" remove="all"/>

    <modify-function signature="QMatrix4x4(const qreal*)">
      <modify-argument index="1">
        <replace-type modified-type="PySequence" />
      </modify-argument>
      <inject-code class="target" position="beginning">
        if (PySequence_Size(%PYARG_1) == 16) {
            qreal values[16];
            for(int i=0; i &lt; 16; i++) {
                PyObject *pv = PySequence_Fast_GET_ITEM(%PYARG_1, i);
                values[i] = PyFloat_AsDouble(pv);
            }

            %0 = new %TYPE(values[0], values[1], values[2], values[3],
                           values[4], values[5], values[6], values[7],
                           values[8], values[9], values[10], values[11],
                           values[12], values[13], values[14], values[15]);
        }
      </inject-code>
    </modify-function>
    <modify-function signature="data()">
      <inject-code class="target" position="beginning">
        <insert-template name="matrix_data_function">
          <replace from="%MATRIX_SIZE" to="16" />
        </insert-template>
      </inject-code>
    </modify-function>
    <modify-function signature="copyDataTo(qreal *) const">
      <modify-argument index="1">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="PyTupleObject*"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        qreal values[16];
        %CPPSELF.%FUNCTION_NAME(values);
        %PYARG_0 = PyTuple_New(16);
        for(int i=0; i &lt; 16; i++) {
          PyObject *v = PyFloat_FromDouble(values[i]);
          PyTuple_SET_ITEM(%PYARG_0, i, v);
        }
      </inject-code>
    </modify-function>

    <modify-function signature="inverted(bool*)const">
      <modify-argument index="1">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="PyTuple"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        <insert-template name="fix_bool*"/>
      </inject-code>
    </modify-function>

    <!-- ### "constData() const" and "data() const" are unnecessary in Python and their function is performed by "data()". -->
    <modify-function signature="data() const" remove="all"/>
    <modify-function signature="constData() const" remove="all"/>
    <!-- ### -->
    <modify-function signature="operator()(int, int) const" remove="all"/>
    <modify-function signature="operator()(int, int)" remove="all"/>
    <add-function signature="__mgetitem__" return-type="PyObject*">
       <inject-code>
         if (PySequence_Check(_key)) {
             Shiboken::AutoDecRef key(PySequence_Fast(_key, "Invalid matrix index."));
             if (PySequence_Fast_GET_SIZE(key.object()) == 2) {
                 PyObject* posx = PySequence_Fast_GET_ITEM(key.object(), 0);
                 PyObject* posy = PySequence_Fast_GET_ITEM(key.object(), 1);
                 Py_ssize_t x = PyInt_AsSsize_t(posx);
                 Py_ssize_t y = PyInt_AsSsize_t(posy);
                 qreal ret = (*%CPPSELF)(x,y);
                 return %CONVERTTOPYTHON[qreal](ret);
             }
         }
         PyErr_SetString(PyExc_IndexError, "Invalid matrix index.");
         return 0;
       </inject-code>
    </add-function>
  </value-type>

  <object-type name="QGesture" since="4.6">
      <enum-type name="GestureCancelPolicy"/>
  </object-type>
  <object-type name="QGestureRecognizer" since="4.6">
      <enum-type name="ResultFlag" flags="Result"/>
  </object-type>
  <object-type name="QTapAndHoldGesture" since="4.6"/>
  <object-type name="QTapGesture" since="4.6"/>
  <object-type name="QGraphicsAnchor" since="4.6"/>
  <object-type name="QGraphicsAnchorLayout" since="4.6"/>
  <object-type name="QGraphicsBlurEffect" since="4.6">
      <enum-type name="BlurHint" flags="BlurHints"/>
  </object-type>
  <object-type name="QGraphicsColorizeEffect" since="4.6"/>
  <object-type name="QGraphicsDropShadowEffect" since="4.6"/>

  <object-type name="QGraphicsEffect" since="4.6">
      <enum-type name="ChangeFlag" flags="ChangeFlags"/>
      <enum-type name="PixmapPadMode"/>
  </object-type>

  <!-- QtInternal
  <object-type name="QGraphicsEffectSource"/>
  -->

  <object-type name="QGraphicsObject" since="4.6" />
  <object-type name="QGraphicsOpacityEffect" since="4.6"/>
  <object-type name="QGraphicsRotation" since="4.6"/>
  <object-type name="QGraphicsScale" since="4.6"/>
  <object-type name="QGraphicsTransform" since="4.6"/>
  <object-type name="QKeyEventTransition" since="4.6"/>
  <object-type name="QMouseEventTransition" since="4.6"/>
  <object-type name="QPanGesture" since="4.6"/>
  <object-type name="QPinchGesture" since="4.6">
      <enum-type name="ChangeFlag" flags="ChangeFlags"/>
  </object-type>
  <value-type name="QQuaternion" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
               <replace from="%REPR_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="dddd" />
              <replace from="%REDUCE_ARGS" to="%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
            </insert-template>
        </inject-code>
    </add-function>
  </value-type>


  <!-- Symbian
  <value-type name="QS60MainApplication"/>
  <value-type name="QS60MainAppUi"/>
  <object-type name="QS60MainDocument"/>
  <value-type name="QS60Style"/>

  <object-type name="QSymbianEvent">
      <enum-type name="Type"/>
  </object-type>
  -->

  <object-type name="QSwipeGesture" since="4.6">
      <enum-type name="SwipeDirection"/>
  </object-type>

  <value-type name="QTileRules" since="4.6"/>

  <object-type name="QTouchEvent" since="4.6">
      <enum-type name="DeviceType"/>
      <value-type name="TouchPoint" since="4.6"/>
  </object-type>

  <value-type name="QVector2D" since="4.6">
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f" />
               <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="dd" />
              <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
            </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="toTuple" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="to_tuple">
                <replace from="%TT_FORMAT" to="dd" />
                <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y()" />
            </insert-template>
        </inject-code>
    </add-function>

  </value-type>
  <value-type name="QVector3D" since="4.6">
    <extra-includes>
      <include file-name="QMatrix4x4" location="global"/>
    </extra-includes>
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f, %f" />
               <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="ddd" />
              <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
            </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="toTuple" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="to_tuple">
                <replace from="%TT_FORMAT" to="ddd" />
                <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()" />
            </insert-template>
        </inject-code>
    </add-function>

  </value-type>
  <value-type name="QVector4D" since="4.6">
    <extra-includes>
      <include file-name="QMatrix4x4" location="global"/>
    </extra-includes>
    <add-function signature="__repr__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="repr_code">
               <replace from="%REPR_FORMAT" to="%f, %f, %f, %f" />
               <replace from="%REPR_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
             </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="__reduce__" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="reduce_code">
              <replace from="%REDUCE_FORMAT" to="dddd" />
              <replace from="%REDUCE_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
            </insert-template>
        </inject-code>
    </add-function>

    <add-function signature="toTuple" return-type="PyObject*">
        <inject-code class="target" position="beginning">
            <insert-template name="to_tuple">
                <replace from="%TT_FORMAT" to="dddd" />
                <replace from="%TT_ARGS" to="%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()" />
            </insert-template>
        </inject-code>
    </add-function>
  </value-type>

  <suppress-warning text="template baseclass 'QGenericMatrix&lt;qreal&gt;' of '*' is not known"/>
  <suppress-warning text="signature 'QApplication(int&amp;,char**)' for function modification in 'QApplication' not found."/>
  <suppress-warning text="signature 'QApplication(int&amp;,char**,bool)' for function modification in 'QApplication' not found."/>
  <suppress-warning text="signature 'QApplication(int&amp;,char**,QApplication::Type)' for function modification in 'QApplication' not found."/>
  <suppress-warning text="signature 'addToolbar(Qt::ToolBarArea,QToolBar*)' for function modification in 'QMainWindow' not found."/>
  <suppress-warning text="signature 'addToolbar(QToolBar*)' for function modification in 'QMainWindow' not found."/>
  <suppress-warning text="signature 'addToolbar(QString)' for function modification in 'QMainWindow' not found."/>
  <suppress-warning text="unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
  <suppress-warning text="unmatched enum ~FlagMask"/>
  <suppress-warning text="enum 'QMatrix4x4::enum_1' is specified in typesystem, but not declared"/>
  <suppress-warning text="class not found for setup inheritance 'QMimeSource'"/>
  <suppress-warning text="class 'QDropEvent' inherits from unknown base class 'QMimeSource'"/>


  <!-- The following entries may be present in the system or not. Keep this section organized. -->
  <object-type name="QAbstractPageSetupDialog"/>
  <object-type name="QAbstractPrintDialog">
    <enum-type name="PrintDialogOption" flags="PrintDialogOptions"/>
    <enum-type name="PrintRange"/>
    <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
  </object-type>

  <object-type name="QGtkStyle">
    <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const">
      <modify-argument index="2">
        <replace-default-expression with="0"/>
      </modify-argument>
      <modify-argument index="3">
        <replace-default-expression with="0"/>
      </modify-argument>
    </modify-function>
  </object-type>

  <object-type name="QPageSetupDialog">
    <enum-type name="PageSetupDialogOption" flags="PageSetupDialogOptions"/>
    <modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
  </object-type>

  <object-type name="QPrintDialog">
    <modify-function signature="exec()" rename="exec_" allow-thread="yes" />
  </object-type>
  <object-type name="QPrintEngine">
    <enum-type name="PrintEnginePropertyKey" />
  </object-type>
  <value-type name="QPrinterInfo" />
  <rejection class="QPrinter" function-name="printerSelectionOption"/>
  <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>

  <object-type name="QPrinter" >
    <enum-type name="ColorMode"/>
    <enum-type name="DuplexMode"/>
    <enum-type name="Orientation"/>
    <enum-type name="OutputFormat"/>
    <enum-type name="PageOrder"/>
    <enum-type name="PageSize" />
    <enum-type name="PaperSource"/>
    <enum-type name="PrintRange"/>
    <enum-type name="PrinterMode"/>
    <enum-type name="PrinterState"/>
    <enum-type name="Unit"/>
    <modify-function signature="getPageMargins(qreal*,qreal*,qreal*,qreal*,QPrinter::Unit)const">
        <modify-argument index="0">
            <replace-type modified-type="PyObject" />
        </modify-argument>
        <modify-argument index="1">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="2">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="3">
            <remove-argument/>
        </modify-argument>
        <modify-argument index="4">
            <remove-argument/>
        </modify-argument>
        <inject-code class="target" position="beginning">
            <insert-template name="fix_number*,number*,number*,number*,args">
                <replace from="$TYPE" to="qreal" />
            </insert-template>
        </inject-code>
    </modify-function>
    <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="2">
        <parent index="this" action="add"/>
      </modify-argument>
    </modify-function>
    <extra-includes>
      <include file-name="QPrinterInfo" location="global"/>
    </extra-includes>
  </object-type>

  <object-type name="QPrintPreviewDialog"/>
  <object-type name="QPrintPreviewWidget">
    <enum-type name="ViewMode"/>
    <enum-type name="ZoomMode"/>
    <modify-function signature="print()" rename="print_" />
  </object-type>

  <object-type name="QSessionManager">
    <extra-includes>
    </extra-includes>
    <enum-type name="RestartHint"/>
    <!-- ### "handle()const" is an internal method. -->
    <modify-function signature="handle()const" remove="all"/>
    <!-- ### -->
  </object-type>

  <object-type name="QSizeGrip"/>

  <object-type name="QSystemTrayIcon">
    <enum-type name="ActivationReason"/>
    <enum-type name="MessageIcon"/>
    <modify-function signature="setContextMenu(QMenu*)">
      <modify-argument index="1">
        <reference-count action="set"/>
      </modify-argument>
    </modify-function>
  </object-type>

  <!-- The above entries may be present in the system or not. Keep this section organized. -->

  <!-- This enum is present on QtCore -->
  <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared" />

</typesystem>

