/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

//workaround to access protected functions
#define protected public

// default includes
#include <shiboken.h>
#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QDebug>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <pyside.h>
#include <pysideqenum.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtgui_python.h"

// main header
#include "qregion_wrapper.h"

// inner classes

// Extra includes
#include <QtGui/qbitmap.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qregion.h>
#include <qbytearray.h>
#include <qdatastream.h>
#include <qpoint.h>
#include <qrect.h>


#include <cctype>
#include <cstring>



template <class T>
static const char *typeNameOf(const T &t)
{
    const char *typeName =  typeid(t).name();
    auto size = std::strlen(typeName);
#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64"
    if (auto lastStar = strchr(typeName, '*')) {
        // MSVC: "class QPaintDevice * __ptr64"
        while (*--lastStar == ' ') {
        }
        size = lastStar - typeName + 1;
    }
#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice"
    if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) {
        ++typeName;
        --size;
    }
#endif
    char *result = new char[size + 1];
    result[size] = '\0';
    memcpy(result, typeName, size);
    return result;
}


// Target ---------------------------------------------------------

extern "C" {
static int
Sbk_QRegion_Init(PyObject *self, PyObject *args, PyObject *kwds)
{
    SbkObject *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::QRegion >()))
        return -1;

    ::QRegion *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__init__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[5];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0, 0, 0, 0};

    // invalid argument lengths
    if (numArgs > 5) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QRegion_Init_TypeError;
    } else if (numArgs == 3)
        goto Sbk_QRegion_Init_TypeError;

    if (!PyArg_ParseTuple(args, "|OOOOO:QRegion", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4])))
        return -1;


    // Overloaded function decisor
    // 0: QRegion::QRegion()
    // 1: QRegion::QRegion(QBitmap)
    // 2: QRegion::QRegion(QPolygon,Qt::FillRule)
    // 3: QRegion::QRegion(QRect,QRegion::RegionType)
    // 4: QRegion::QRegion(QRegion)
    // 5: QRegion::QRegion(int,int,int,int,QRegion::RegionType)
    if (numArgs == 0) {
        overloadId = 0; // QRegion()
    } else if (numArgs >= 4
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))
        && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[2])))
        && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[3])))) {
        if (numArgs == 4) {
            overloadId = 5; // QRegion(int,int,int,int,QRegion::RegionType)
        } else if (numArgs >= 5
            && (pythonToCpp[4] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX]))->converter, (pyArgs[4])))) {
            overloadId = 5; // QRegion(int,int,int,int,QRegion::RegionType)
        }
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 3; // QRegion(QRect,QRegion::RegionType)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 3; // QRegion(QRect,QRegion::RegionType)
        }
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPOLYGON_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 2; // QRegion(QPolygon,Qt::FillRule)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_FILLRULE_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 2; // QRegion(QPolygon,Qt::FillRule)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], (pyArgs[0])))) {
        overloadId = 1; // QRegion(QBitmap)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArgs[0])))) {
        overloadId = 4; // QRegion(QRegion)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegion_Init_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // QRegion()
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QRegion_Init_TypeError;
            }

            if (!PyErr_Occurred()) {
                // QRegion()
                cptr = new ::QRegion();
            }
            break;
        }
        case 1: // QRegion(const QBitmap & bitmap)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QRegion_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QBitmap cppArg0_local;
            ::QBitmap *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QRegion(QBitmap)
                cptr = new ::QRegion(*cppArg0);
            }
            break;
        }
        case 2: // QRegion(const QPolygon & pa, Qt::FillRule fillRule)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_fillRule = Shiboken::String::createStaticString("fillRule");
                if (PyDict_Contains(kwds, key_fillRule)) {
                    value = PyDict_GetItem(kwds, key_fillRule);
                    if (value && pyArgs[1]) {
                        errInfo.reset(key_fillRule);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QRegion_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[1] = value;
                        if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_FILLRULE_IDX]))->converter, (pyArgs[1]))))
                            goto Sbk_QRegion_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_fillRule);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QRegion_Init_TypeError;
                }
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QPolygon cppArg0_local;
            ::QPolygon *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            ::Qt::FillRule cppArg1(Qt::OddEvenFill);
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QRegion(QPolygon,Qt::FillRule)
                cptr = new ::QRegion(*cppArg0, cppArg1);
            }
            break;
        }
        case 3: // QRegion(const QRect & r, QRegion::RegionType t)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_t = Shiboken::String::createStaticString("t");
                if (PyDict_Contains(kwds, key_t)) {
                    value = PyDict_GetItem(kwds, key_t);
                    if (value && pyArgs[1]) {
                        errInfo.reset(key_t);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QRegion_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[1] = value;
                        if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX]))->converter, (pyArgs[1]))))
                            goto Sbk_QRegion_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_t);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QRegion_Init_TypeError;
                }
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            ::QRegion::RegionType cppArg1(QRegion::RegionType::Rectangle);
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QRegion(QRect,QRegion::RegionType)
                cptr = new ::QRegion(*cppArg0, cppArg1);
            }
            break;
        }
        case 4: // QRegion(const QRegion & region)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QRegion_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QRegion(QRegion)
                cptr = new ::QRegion(*cppArg0);
            }
            break;
        }
        case 5: // QRegion(int x, int y, int w, int h, QRegion::RegionType t)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_t = Shiboken::String::createStaticString("t");
                if (PyDict_Contains(kwds, key_t)) {
                    value = PyDict_GetItem(kwds, key_t);
                    if (value && pyArgs[4]) {
                        errInfo.reset(key_t);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QRegion_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[4] = value;
                        if (!(pythonToCpp[4] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX]))->converter, (pyArgs[4]))))
                            goto Sbk_QRegion_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_t);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QRegion_Init_TypeError;
                }
            }
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            int cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);
            int cppArg2;
            pythonToCpp[2](pyArgs[2], &cppArg2);
            int cppArg3;
            pythonToCpp[3](pyArgs[3], &cppArg3);
            ::QRegion::RegionType cppArg4(QRegion::RegionType::Rectangle);
            if (pythonToCpp[4])
                pythonToCpp[4](pyArgs[4], &cppArg4);

            if (!PyErr_Occurred()) {
                // QRegion(int,int,int,int,QRegion::RegionType)
                cptr = new ::QRegion(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QRegion >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (!cptr) goto Sbk_QRegion_Init_TypeError;

    Shiboken::Object::setValidCpp(sbkSelf, true);
    if (Shiboken::BindingManager::instance().hasWrapper(cptr)) {
        Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr));
    }
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;

    Sbk_QRegion_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

static PyObject *Sbk_QRegionFunc_begin(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.begin";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // begin()const
            const QRect * cppResult = const_cast<const ::QRegion *>(cppSelf)->begin();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_boundingRect(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.boundingRect";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // boundingRect()const
            QRect cppResult = const_cast<const ::QRegion *>(cppSelf)->boundingRect();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_cbegin(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.cbegin";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // cbegin()const
            const QRect * cppResult = const_cast<const ::QRegion *>(cppSelf)->cbegin();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_cend(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.cend";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // cend()const
            const QRect * cppResult = const_cast<const ::QRegion *>(cppSelf)->cend();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_contains(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.contains";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::contains(QPoint)const->bool
    // 1: QRegion::contains(QRect)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 1; // contains(QRect)const
    } else if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], (pyArg)))) {
        overloadId = 0; // contains(QPoint)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_contains_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // contains(const QPoint & p) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QPoint cppArg0_local;
            ::QPoint *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // contains(QPoint)const
                bool cppResult = const_cast<const ::QRegion *>(cppSelf)->contains(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            }
            break;
        }
        case 1: // contains(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // contains(QRect)const
                bool cppResult = const_cast<const ::QRegion *>(cppSelf)->contains(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_contains_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_end(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.end";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // end()const
            const QRect * cppResult = const_cast<const ::QRegion *>(cppSelf)->end();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_intersected(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.intersected";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::intersected(QRect)const->QRegion
    // 1: QRegion::intersected(QRegion)const->QRegion
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // intersected(QRect)const
    } else if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // intersected(QRegion)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_intersected_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // intersected(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // intersected(QRect)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->intersected(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
        case 1: // intersected(const QRegion & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // intersected(QRegion)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->intersected(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_intersected_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_intersects(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.intersects";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::intersects(QRect)const->bool
    // 1: QRegion::intersects(QRegion)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // intersects(QRect)const
    } else if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // intersects(QRegion)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_intersects_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // intersects(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // intersects(QRect)const
                bool cppResult = const_cast<const ::QRegion *>(cppSelf)->intersects(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            }
            break;
        }
        case 1: // intersects(const QRegion & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // intersects(QRegion)const
                bool cppResult = const_cast<const ::QRegion *>(cppSelf)->intersects(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_intersects_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_isEmpty(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.isEmpty";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // isEmpty()const
            bool cppResult = const_cast<const ::QRegion *>(cppSelf)->isEmpty();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_isNull(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.isNull";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // isNull()const
            bool cppResult = const_cast<const ::QRegion *>(cppSelf)->isNull();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_rectCount(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.rectCount";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // rectCount()const
            int cppResult = const_cast<const ::QRegion *>(cppSelf)->rectCount();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QRegionFunc_setRects(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.setRects";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "setRects", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QRegion::setRects(const QRect*,int)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))) {
        overloadId = 0; // setRects(const QRect*,int)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_setRects_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QRect *cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        int cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // setRects(const QRect*,int)
            cppSelf->setRects(cppArg0, cppArg1);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QRegionFunc_setRects_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_subtracted(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.subtracted";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::subtracted(QRegion)const->QRegion
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // subtracted(QRegion)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_subtracted_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // subtracted(QRegion)const
            QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->subtracted(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_subtracted_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_swap(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.swap";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::swap(QRegion&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // swap(QRegion&)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_swap_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // swap(QRegion&)
            cppSelf->swap(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QRegionFunc_swap_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_translate(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.translate";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "translate", 1, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QRegion::translate(QPoint)
    // 1: QRegion::translate(int,int)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))) {
        overloadId = 1; // translate(int,int)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], (pyArgs[0])))) {
        overloadId = 0; // translate(QPoint)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_translate_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // translate(const QPoint & p)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QPoint cppArg0_local;
            ::QPoint *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // translate(QPoint)
                cppSelf->translate(*cppArg0);
            }
            break;
        }
        case 1: // translate(int dx, int dy)
        {
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            int cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // translate(int,int)
                cppSelf->translate(cppArg0, cppArg1);
            }
            break;
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QRegionFunc_translate_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_translated(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.translated";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "translated", 1, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QRegion::translated(QPoint)const->QRegion
    // 1: QRegion::translated(int,int)const->QRegion
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))) {
        overloadId = 1; // translated(int,int)const
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], (pyArgs[0])))) {
        overloadId = 0; // translated(QPoint)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_translated_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // translated(const QPoint & p) const
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QPoint cppArg0_local;
            ::QPoint *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // translated(QPoint)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->translated(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
        case 1: // translated(int dx, int dy) const
        {
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            int cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // translated(int,int)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->translated(cppArg0, cppArg1);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_translated_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_united(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.united";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::united(QRect)const->QRegion
    // 1: QRegion::united(QRegion)const->QRegion
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // united(QRect)const
    } else if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // united(QRegion)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_united_TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // united(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // united(QRect)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->united(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
        case 1: // united(const QRegion & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // united(QRegion)const
                QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->united(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_united_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc_xored(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.xored";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::xored(QRegion)const->QRegion
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // xored(QRegion)const
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc_xored_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // xored(QRegion)const
            QRegion cppResult = const_cast<const ::QRegion *>(cppSelf)->xored(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc_xored_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegion___copy__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppSelf);
    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


static const char *Sbk_QRegion_PropertyStrings[] = {
    nullptr // Sentinel
};

static PyMethodDef Sbk_QRegion_methods[] = {
    {"begin", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_begin), METH_NOARGS},
    {"boundingRect", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_boundingRect), METH_NOARGS},
    {"cbegin", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_cbegin), METH_NOARGS},
    {"cend", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_cend), METH_NOARGS},
    {"contains", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_contains), METH_O},
    {"end", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_end), METH_NOARGS},
    {"intersected", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_intersected), METH_O},
    {"intersects", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_intersects), METH_O},
    {"isEmpty", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_isEmpty), METH_NOARGS},
    {"isNull", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_isNull), METH_NOARGS},
    {"rectCount", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_rectCount), METH_NOARGS},
    {"setRects", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_setRects), METH_VARARGS},
    {"subtracted", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_subtracted), METH_O},
    {"swap", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_swap), METH_O},
    {"translate", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_translate), METH_VARARGS},
    {"translated", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_translated), METH_VARARGS},
    {"united", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_united), METH_O},
    {"xored", reinterpret_cast<PyCFunction>(Sbk_QRegionFunc_xored), METH_O},

    {"__copy__", reinterpret_cast<PyCFunction>(Sbk_QRegion___copy__), METH_NOARGS},
    {nullptr, nullptr} // Sentinel
};

static int Sbk_QRegion___nb_bool(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return -1;
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    return cppSelf->isNull() ? 0 : 1;
}

static PyObject *Sbk_QRegionFunc___and__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__and__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator&(QRect)const->QRegion
    // 1: QRegion::operator&(QRegion)const->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // operator&(QRect)const
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // operator&(QRegion)const
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___and___TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // operator&(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator&(QRect)const
                QRegion cppResult = (*cppSelf) & (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator&(const QRegion & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator&(QRegion)const
                QRegion cppResult = (*cppSelf) & (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___and___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___mul__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__mul__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator*(QTransform)->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QTRANSFORM_IDX], (pyArg)))) {
        overloadId = 0; // operator*(QRegion,QTransform)
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___mul___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QTransform cppArg0_local;
        ::QTransform *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator*(QRegion,QTransform)
            QRegion cppResult = (*cppSelf) * (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___mul___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___add__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__add__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator+(QRect)const->QRegion
    // 1: QRegion::operator+(QRegion)const->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // operator+(QRect)const
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // operator+(QRegion)const
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___add___TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // operator+(const QRect & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator+(QRect)const
                QRegion cppResult = (*cppSelf) + (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator+(const QRegion & r) const
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator+(QRegion)const
                QRegion cppResult = (*cppSelf) + (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___add___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___iadd__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__iadd__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator+=(QRect)->QRegion&
    // 1: QRegion::operator+=(QRegion)->QRegion&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], (pyArg)))) {
        overloadId = 0; // operator+=(QRect)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 1; // operator+=(QRegion)
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___iadd___TypeError;

    // Call function/method
    switch (overloadId) {
        case 0: // operator+=(const QRect & r)
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRect cppArg0_local;
            ::QRect *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator+=(QRect)
                (*cppSelf) += (*cppArg0);
            }
            break;
        }
        case 1: // operator+=(const QRegion & r)
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QRegion cppArg0_local;
            ::QRegion *cppArg0 = &cppArg0_local;
            if (pythonToCpp.isValue())
                pythonToCpp(pyArg, &cppArg0_local);
            else
                pythonToCpp(pyArg, &cppArg0);


            if (!PyErr_Occurred()) {
                // operator+=(QRegion)
                (*cppSelf) += (*cppArg0);
            }
            break;
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_INCREF(self);
    return self;

    Sbk_QRegionFunc___iadd___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___sub__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__sub__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator-(QRegion)const->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator-(QRegion)const
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___sub___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator-(QRegion)const
            QRegion cppResult = (*cppSelf) - (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___sub___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___isub__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__isub__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator-=(QRegion)->QRegion&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator-=(QRegion)
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___isub___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator-=(QRegion)
            (*cppSelf) -= (*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_INCREF(self);
    return self;

    Sbk_QRegionFunc___isub___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___lshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__lshift__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    Shiboken::AutoDecRef attrName(Py_BuildValue("s", "__rlshift__"));
    if (!isReverse
        && Shiboken::Object::checkType(pyArg)
        && !PyObject_TypeCheck(pyArg, self->ob_type)
        && PyObject_HasAttr(pyArg, attrName)) {
        PyObject *revOpMethod = PyObject_GetAttr(pyArg, attrName);
        if (revOpMethod && PyCallable_Check(revOpMethod)) {
            pyResult = PyObject_CallFunction(revOpMethod, "O", self);
            if (PyErr_Occurred() && (PyErr_ExceptionMatches(PyExc_NotImplementedError) || PyErr_ExceptionMatches(PyExc_AttributeError))) {
                PyErr_Clear();
                Py_XDECREF(pyResult);
                pyResult = nullptr;
            }
        }
        Py_XDECREF(revOpMethod);

    }

    // Do not enter here if other object has implemented a reverse operator.
    if (!pyResult) {
        // Overloaded function decisor
        // 0: QRegion::operator<<(QDataStream&)->QDataStream&
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QDATASTREAM_IDX], (pyArg)))) {
            overloadId = 0; // operator<<(QDataStream&,QRegion)
        }

        if (isReverse && overloadId == -1) {
            PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
            return {};
        }

        // Function signature not found.
        if (overloadId == -1) goto Sbk_QRegionFunc___lshift___TypeError;

        // Call function/method
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QDataStream *cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator<<(QDataStream&,QRegion) [reverse operator]
                QDataStream & cppResult = (*cppArg0) << (*cppSelf);
                pyResult = Shiboken::Conversions::referenceToPython(SbkPySide6_QtCoreTypes[SBK_QDATASTREAM_IDX], &cppResult);
            }
        }

    } // End of "if (!pyResult)"

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___lshift___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___rshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__rshift__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    Shiboken::AutoDecRef attrName(Py_BuildValue("s", "__rrshift__"));
    if (!isReverse
        && Shiboken::Object::checkType(pyArg)
        && !PyObject_TypeCheck(pyArg, self->ob_type)
        && PyObject_HasAttr(pyArg, attrName)) {
        PyObject *revOpMethod = PyObject_GetAttr(pyArg, attrName);
        if (revOpMethod && PyCallable_Check(revOpMethod)) {
            pyResult = PyObject_CallFunction(revOpMethod, "O", self);
            if (PyErr_Occurred() && (PyErr_ExceptionMatches(PyExc_NotImplementedError) || PyErr_ExceptionMatches(PyExc_AttributeError))) {
                PyErr_Clear();
                Py_XDECREF(pyResult);
                pyResult = nullptr;
            }
        }
        Py_XDECREF(revOpMethod);

    }

    // Do not enter here if other object has implemented a reverse operator.
    if (!pyResult) {
        // Overloaded function decisor
        // 0: QRegion::operator>>(QDataStream&)->QDataStream&
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QDATASTREAM_IDX], (pyArg)))) {
            overloadId = 0; // operator>>(QDataStream&,QRegion&)
        }

        if (isReverse && overloadId == -1) {
            PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
            return {};
        }

        // Function signature not found.
        if (overloadId == -1) goto Sbk_QRegionFunc___rshift___TypeError;

        // Call function/method
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QDataStream *cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator>>(QDataStream&,QRegion&) [reverse operator]
                QDataStream & cppResult = (*cppArg0) >> (*cppSelf);
                pyResult = Shiboken::Conversions::referenceToPython(SbkPySide6_QtCoreTypes[SBK_QDATASTREAM_IDX], &cppResult);
            }
        }

    } // End of "if (!pyResult)"

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___rshift___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___xor__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__xor__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator^(QRegion)const->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator^(QRegion)const
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___xor___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator^(QRegion)const
            QRegion cppResult = (*cppSelf) ^ (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___xor___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___ixor__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__ixor__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator^=(QRegion)->QRegion&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator^=(QRegion)
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___ixor___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator^=(QRegion)
            (*cppSelf) ^= (*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_INCREF(self);
    return self;

    Sbk_QRegionFunc___ixor___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___or__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__or__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator|(QRegion)const->QRegion
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator|(QRegion)const
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___or___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator|(QRegion)const
            QRegion cppResult = (*cppSelf) | (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QRegionFunc___or___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QRegionFunc___ior__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], pyArg)
                    && !SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QRegion.__ior__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QRegion::operator|=(QRegion)->QRegion&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
        overloadId = 0; // operator|=(QRegion)
    }

    if (isReverse && overloadId == -1) {
        PyErr_SetString(PyExc_NotImplementedError, "reverse operator not implemented.");
        return {};
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QRegionFunc___ior___TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QRegion cppArg0_local;
        ::QRegion *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // operator|=(QRegion)
            (*cppSelf) |= (*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_INCREF(self);
    return self;

    Sbk_QRegionFunc___ior___TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

Py_ssize_t Sbk_QRegionFunc___len__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    // Begin code injection
    // ========================================================================
    // START of custom code block [file: ../glue/qtgui.cpp (qregion-len)]
    return cppSelf->rectCount();
    // END of custom code block [file: ../glue/qtgui.cpp (qregion-len)]
    // ========================================================================
    // End of code injection

}

PyObject* Sbk_QRegionFunc___getitem__(PyObject *self, Py_ssize_t _i)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    // Begin code injection
    // ========================================================================
    // START of custom code block [file: ../glue/qtgui.cpp (qregion-getitem)]
    if (_i < 0 || _i >= cppSelf->rectCount()) {
        PyErr_SetString(PyExc_IndexError, "index out of bounds");
        return nullptr;
    }

    const QRect cppResult = *(cppSelf->cbegin() + _i);
    return Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], &cppResult);
    // END of custom code block [file: ../glue/qtgui.cpp (qregion-getitem)]
    // ========================================================================
    // End of code injection

}

// Rich comparison
static PyObject * Sbk_QRegion_richcompare(PyObject *self, PyObject *pyArg, int op)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    switch (op) {
        case Py_NE:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
                // operator!=(const QRegion & r) const
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QRegion cppArg0_local;
                ::QRegion *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf !=(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                pyResult = Py_True;
                Py_INCREF(pyResult);
            }

            break;
        case Py_EQ:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], (pyArg)))) {
                // operator==(const QRegion & r) const
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QRegion cppArg0_local;
                ::QRegion *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf ==(*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                pyResult = Py_False;
                Py_INCREF(pyResult);
            }

            break;
        default:
            // PYSIDE-74: By default, we redirect to object's tp_richcompare (which is `==`, `!=`).
            return FallbackRichCompare(self, pyArg, op);
            goto Sbk_QRegion_RichComparison_TypeError;
    }

    if (pyResult && !PyErr_Occurred())
        return pyResult;
    Sbk_QRegion_RichComparison_TypeError:
    PyErr_SetString(PyExc_NotImplementedError, "operator not implemented.");
    return {};

}

} // extern "C"

static int Sbk_QRegion_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QRegion_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
extern "C"
{
static PyObject *Sbk_QRegion__repr__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    QBuffer buffer;
    buffer.open(QBuffer::ReadWrite);
    QDebug dbg(&buffer);
    dbg << *cppSelf;
    buffer.close();
    QByteArray str = buffer.data();
    int idx = str.indexOf('(');
    if (idx >= 0)
        str.replace(0, idx, Py_TYPE(self)->tp_name);
    str = str.trimmed();
    PyObject *mod = PyDict_GetItem(Py_TYPE(self)->tp_dict, Shiboken::PyMagicName::module());
    if (mod && !strchr(str, '.'))
        return Shiboken::String::fromFormat("<%s.%s at %p>", Shiboken::String::toCString(mod), str.constData(), self);
    else
        return Shiboken::String::fromFormat("<%s at %p>", str.constData(), self);
}
} // extern C

// Class Definition -----------------------------------------------
extern "C" {
static PyTypeObject *_Sbk_QRegion_Type = nullptr;
static PyTypeObject *Sbk_QRegion_TypeF(void)
{
    return _Sbk_QRegion_Type;
}

static PyType_Slot Sbk_QRegion_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        reinterpret_cast<void *>(Sbk_QRegion__repr__)},
    {Py_tp_hash,        nullptr},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    nullptr},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QRegion_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QRegion_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_QRegion_richcompare)},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QRegion_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QRegion_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    // type supports sequence protocol
    {Py_sq_length, reinterpret_cast<void *>(&Sbk_QRegionFunc___len__)},
    {Py_sq_item, reinterpret_cast<void *>(&Sbk_QRegionFunc___getitem__)},
    // type supports number protocol
    {Py_nb_inplace_add, reinterpret_cast<void *>(Sbk_QRegionFunc___iadd__)},
    {Py_nb_and, reinterpret_cast<void *>(Sbk_QRegionFunc___and__)},
    {Py_nb_inplace_xor, reinterpret_cast<void *>(Sbk_QRegionFunc___ixor__)},
    {Py_nb_subtract, reinterpret_cast<void *>(Sbk_QRegionFunc___sub__)},
    {Py_nb_or, reinterpret_cast<void *>(Sbk_QRegionFunc___or__)},
    {Py_nb_inplace_subtract, reinterpret_cast<void *>(Sbk_QRegionFunc___isub__)},
    {Py_nb_xor, reinterpret_cast<void *>(Sbk_QRegionFunc___xor__)},
    {Py_nb_lshift, reinterpret_cast<void *>(Sbk_QRegionFunc___lshift__)},
    {Py_nb_inplace_or, reinterpret_cast<void *>(Sbk_QRegionFunc___ior__)},
    {Py_nb_multiply, reinterpret_cast<void *>(Sbk_QRegionFunc___mul__)},
    {Py_nb_bool, reinterpret_cast<void *>(Sbk_QRegion___nb_bool)},
    {Py_nb_rshift, reinterpret_cast<void *>(Sbk_QRegionFunc___rshift__)},
    {Py_nb_add, reinterpret_cast<void *>(Sbk_QRegionFunc___add__)},
    {0, nullptr}
};
static PyType_Spec Sbk_QRegion_spec = {
    "2:PySide6.QtGui.QRegion",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QRegion_slots
};

} //extern "C"


// Type conversion functions.

// Python to C++ enum conversion.
static void QRegion_RegionType_PythonToCpp_QRegion_RegionType(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QRegion::RegionType *>(cppOut) =
        static_cast<::QRegion::RegionType>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QRegion_RegionType_PythonToCpp_QRegion_RegionType_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX]))
        return QRegion_RegionType_PythonToCpp_QRegion_RegionType;
    return {};
}
static PyObject *QRegion_RegionType_CppToPython_QRegion_RegionType(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QRegion::RegionType *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX], castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QRegion_PythonToCpp_QRegion_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QRegion_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QRegion_PythonToCpp_QRegion_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QRegion_TypeF())))
        return QRegion_PythonToCpp_QRegion_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QRegion_PTR_CppToPython_QRegion(const void *cppIn)
{
    auto pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    bool changedTypeName = false;
    auto tCppIn = reinterpret_cast<const ::QRegion *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName);
    if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) {
        typeName = typeNameOf(tCppIn);
        changedTypeName = true;
    }
    PyObject *result = Shiboken::Object::newObject(Sbk_QRegion_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// C++ to Python copy conversion.
static PyObject *QRegion_COPY_CppToPython_QRegion(const void *cppIn)
{
    return Shiboken::Object::newObject(Sbk_QRegion_TypeF(), new ::QRegion(*reinterpret_cast<const ::QRegion *>(cppIn)), true, true);
}

// Python to C++ copy conversion.
static void QRegion_PythonToCpp_QRegion_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QRegion *>(cppOut) = *reinterpret_cast< ::QRegion *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QREGION_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QRegion_PythonToCpp_QRegion_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QRegion_TypeF())))
        return QRegion_PythonToCpp_QRegion_COPY;
    return {};
}

// Implicit conversions.
static void constQBitmapREF_PythonToCpp_QRegion(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QRegion *>(cppOut) = ::QRegion( *reinterpret_cast< ::QBitmap *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], reinterpret_cast<SbkObject *>(pyIn))));
}
static PythonToCppFunc is_constQBitmapREF_PythonToCpp_QRegion_Convertible(PyObject *pyIn)
{
    if (SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], pyIn))
        return constQBitmapREF_PythonToCpp_QRegion;
    return {};
}

static void constQPolygonREF_PythonToCpp_QRegion(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QRegion *>(cppOut) = ::QRegion( *reinterpret_cast< ::QPolygon *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPOLYGON_IDX], reinterpret_cast<SbkObject *>(pyIn))));
}
static PythonToCppFunc is_constQPolygonREF_PythonToCpp_QRegion_Convertible(PyObject *pyIn)
{
    if (SbkObject_TypeCheck(SbkPySide6_QtGuiTypes[SBK_QPOLYGON_IDX], pyIn))
        return constQPolygonREF_PythonToCpp_QRegion;
    return {};
}

static void PySide6_QtCore_constQRectREF_PythonToCpp_QRegion(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QRegion *>(cppOut) = ::QRegion( *reinterpret_cast< ::QRect *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], reinterpret_cast<SbkObject *>(pyIn))));
}
static PythonToCppFunc is_PySide6_QtCore_constQRectREF_PythonToCpp_QRegion_Convertible(PyObject *pyIn)
{
    if (SbkObject_TypeCheck(SbkPySide6_QtCoreTypes[SBK_QRECT_IDX], pyIn))
        return PySide6_QtCore_constQRectREF_PythonToCpp_QRegion;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QRegion_SignatureStrings[] = {
    "5:PySide6.QtGui.QRegion(self)",
    "4:PySide6.QtGui.QRegion(self,bitmap:typing.Union[PySide6.QtGui.QBitmap, QString])",
    "3:PySide6.QtGui.QRegion(self,pa:typing.Union[PySide6.QtGui.QPolygon, QList[PySide6.QtCore.QPoint], PySide6.QtCore.QRect],fillRule:PySide6.QtCore.Qt.FillRule=Qt.OddEvenFill)",
    "2:PySide6.QtGui.QRegion(self,r:PySide6.QtCore.QRect,t:PySide6.QtGui.QRegion.RegionType=QRegion.RegionType.Rectangle)",
    "1:PySide6.QtGui.QRegion(self,region:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])",
    "0:PySide6.QtGui.QRegion(self,x:int,y:int,w:int,h:int,t:PySide6.QtGui.QRegion.RegionType=QRegion.RegionType.Rectangle)",
    "PySide6.QtGui.QRegion.begin(self)->PySide6.QtCore.QRect",
    "PySide6.QtGui.QRegion.boundingRect(self)->PySide6.QtCore.QRect",
    "PySide6.QtGui.QRegion.cbegin(self)->PySide6.QtCore.QRect",
    "PySide6.QtGui.QRegion.cend(self)->PySide6.QtCore.QRect",
    "1:PySide6.QtGui.QRegion.contains(self,p:PySide6.QtCore.QPoint)->bool",
    "0:PySide6.QtGui.QRegion.contains(self,r:PySide6.QtCore.QRect)->bool",
    "PySide6.QtGui.QRegion.end(self)->PySide6.QtCore.QRect",
    "1:PySide6.QtGui.QRegion.intersected(self,r:PySide6.QtCore.QRect)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.intersected(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "1:PySide6.QtGui.QRegion.intersects(self,r:PySide6.QtCore.QRect)->bool",
    "0:PySide6.QtGui.QRegion.intersects(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->bool",
    "PySide6.QtGui.QRegion.isEmpty(self)->bool",
    "PySide6.QtGui.QRegion.isNull(self)->bool",
    "PySide6.QtGui.QRegion.rectCount(self)->int",
    "PySide6.QtGui.QRegion.setRects(self,rect:PySide6.QtCore.QRect,num:int)",
    "PySide6.QtGui.QRegion.subtracted(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.swap(self,other:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])",
    "1:PySide6.QtGui.QRegion.translate(self,p:PySide6.QtCore.QPoint)",
    "0:PySide6.QtGui.QRegion.translate(self,dx:int,dy:int)",
    "1:PySide6.QtGui.QRegion.translated(self,p:PySide6.QtCore.QPoint)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.translated(self,dx:int,dy:int)->PySide6.QtGui.QRegion",
    "1:PySide6.QtGui.QRegion.united(self,r:PySide6.QtCore.QRect)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.united(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.xored(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__copy__()",
    "1:PySide6.QtGui.QRegion.__and__(self,r:PySide6.QtCore.QRect)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.__and__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__mul__(self,m:PySide6.QtGui.QTransform)->PySide6.QtGui.QRegion",
    "1:PySide6.QtGui.QRegion.__add__(self,r:PySide6.QtCore.QRect)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.__add__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "1:PySide6.QtGui.QRegion.__iadd__(self,r:PySide6.QtCore.QRect)->PySide6.QtGui.QRegion",
    "0:PySide6.QtGui.QRegion.__iadd__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__sub__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__isub__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__lshift__(self,arg__1:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    "PySide6.QtGui.QRegion.__rshift__(self,arg__1:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    "PySide6.QtGui.QRegion.__xor__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__ixor__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__or__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    "PySide6.QtGui.QRegion.__ior__(self,r:typing.Union[PySide6.QtGui.QRegion, PySide6.QtGui.QBitmap, PySide6.QtGui.QPolygon, PySide6.QtCore.QRect])->PySide6.QtGui.QRegion",
    nullptr}; // Sentinel

void init_QRegion(PyObject *module)
{
    _Sbk_QRegion_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QRegion",
        "QRegion",
        &Sbk_QRegion_spec,
        &Shiboken::callCppDestructor< ::QRegion >,
        0,
        0,
        0);
    auto *pyType = Sbk_QRegion_TypeF(); // references _Sbk_QRegion_Type
    InitSignatureStrings(pyType, QRegion_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QRegion_Type), Sbk_QRegion_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QREGION_IDX]
        = Sbk_QRegion_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QRegion_TypeF(),
        QRegion_PythonToCpp_QRegion_PTR,
        is_QRegion_PythonToCpp_QRegion_PTR_Convertible,
        QRegion_PTR_CppToPython_QRegion,
        QRegion_COPY_CppToPython_QRegion);

    Shiboken::Conversions::registerConverterName(converter, "QRegion");
    Shiboken::Conversions::registerConverterName(converter, "QRegion*");
    Shiboken::Conversions::registerConverterName(converter, "QRegion&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::QRegion).name());

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QRegion_PythonToCpp_QRegion_COPY,
        is_QRegion_PythonToCpp_QRegion_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        constQBitmapREF_PythonToCpp_QRegion,
        is_constQBitmapREF_PythonToCpp_QRegion_Convertible);
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        constQPolygonREF_PythonToCpp_QRegion,
        is_constQPolygonREF_PythonToCpp_QRegion_Convertible);
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        PySide6_QtCore_constQRectREF_PythonToCpp_QRegion,
        is_PySide6_QtCore_constQRectREF_PythonToCpp_QRegion_Convertible);

    // Initialization of enums.

    // Initialization of enum 'RegionType'.
    SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QRegion_TypeF(),
        "RegionType",
        "2:PySide6.QtGui.QRegion.RegionType",
        "QRegion::RegionType");
    if (!SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX],
        Sbk_QRegion_TypeF(), "Rectangle", (long) QRegion::RegionType::Rectangle))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX],
        Sbk_QRegion_TypeF(), "Ellipse", (long) QRegion::RegionType::Ellipse))
        return;
    // Register converter for enum 'QRegion::RegionType'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX],
            QRegion_RegionType_CppToPython_QRegion_RegionType);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QRegion_RegionType_PythonToCpp_QRegion_RegionType,
            is_QRegion_RegionType_PythonToCpp_QRegion_RegionType_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtGuiTypes[SBK_QREGION_REGIONTYPE_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QRegion::RegionType");
        Shiboken::Conversions::registerConverterName(converter, "RegionType");
    }
    // End of 'RegionType' enum.

    qRegisterMetaType< ::QRegion >("QRegion");
    qRegisterMetaType< ::QRegion::RegionType >("QRegion::RegionType");
}
