/****************************************************************************
**
** 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_qtcore_python.h"

// main header
#include "qmargins_wrapper.h"

// inner classes

// Extra includes
#include <qmargins.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_QMargins_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< ::QMargins >()))
        return -1;

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

    // invalid argument lengths
    if (numArgs == 2 || numArgs == 3)
        goto Sbk_QMargins_Init_TypeError;

    if (!PyArg_UnpackTuple(args, "QMargins", 0, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3])))
        return -1;


    // Overloaded function decisor
    // 0: QMargins::QMargins()
    // 1: QMargins::QMargins(QMargins)
    // 2: QMargins::QMargins(int,int,int,int)
    if (numArgs == 0) {
        overloadId = 0; // QMargins()
    } 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])))) {
        overloadId = 2; // QMargins(int,int,int,int)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], (pyArgs[0])))) {
        overloadId = 1; // QMargins(QMargins)
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // QMargins()
        {

            if (!PyErr_Occurred()) {
                // QMargins()
                cptr = new ::QMargins();
            }
            break;
        }
        case 1: // QMargins(const QMargins & QMargins)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QMargins cppArg0_local;
            ::QMargins *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QMargins(QMargins)
                cptr = new ::QMargins(*cppArg0);
            }
            break;
        }
        case 2: // QMargins(int left, int top, int right, int bottom)
        {
            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);

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

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QMargins >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (!cptr) goto Sbk_QMargins_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_QMargins_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

static PyObject *Sbk_QMarginsFunc_bottom(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.bottom";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QMarginsFunc_isNull(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.isNull";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QMarginsFunc_left(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.left";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QMarginsFunc_right(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.right";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QMarginsFunc_setBottom(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.setBottom";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QMargins::setBottom(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // setBottom(int)
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setBottom(int)
            cppSelf->setBottom(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QMarginsFunc_setLeft(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.setLeft";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QMargins::setLeft(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // setLeft(int)
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setLeft(int)
            cppSelf->setLeft(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QMarginsFunc_setRight(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.setRight";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QMargins::setRight(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // setRight(int)
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setRight(int)
            cppSelf->setRight(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QMarginsFunc_setTop(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.setTop";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QMargins::setTop(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // setTop(int)
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setTop(int)
            cppSelf->setTop(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QMarginsFunc_top(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.top";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

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


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

static PyMethodDef Sbk_QMargins_methods[] = {
    {"bottom", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_bottom), METH_NOARGS},
    {"isNull", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_isNull), METH_NOARGS},
    {"left", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_left), METH_NOARGS},
    {"right", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_right), METH_NOARGS},
    {"setBottom", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_setBottom), METH_O},
    {"setLeft", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_setLeft), METH_O},
    {"setRight", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_setRight), METH_O},
    {"setTop", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_setTop), METH_O},
    {"top", reinterpret_cast<PyCFunction>(Sbk_QMarginsFunc_top), METH_NOARGS},

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator*(int)->QMargins
    // 1: QMargins::operator*(int)->QMargins
    // 2: QMargins::operator*(qreal)->QMargins
    // 3: QMargins::operator*(qreal)->QMargins
    if (!isReverse
        && PyFloat_Check(pyArg) && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 3; // operator*(QMargins,qreal)
    } else if (isReverse
        && PyFloat_Check(pyArg) && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 2; // operator*(qreal,QMargins)
    } else if (isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 1; // operator*(int,QMargins)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // operator*(QMargins,int)
    }

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

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

    // Call function/method
    switch (overloadId) {
        case 0: // operator*(int factor)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator*(QMargins,int)
                QMargins cppResult = (*cppSelf) * cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator*(int factor)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator*(int,QMargins) [reverse operator]
                QMargins cppResult = cppArg0 * (*cppSelf);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 2: // operator*(qreal factor)
        {
            qreal cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator*(qreal,QMargins) [reverse operator]
                QMargins cppResult = cppArg0 * (*cppSelf);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 3: // operator*(qreal factor)
        {
            qreal cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator*(QMargins,qreal)
                QMargins cppResult = (*cppSelf) * cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator*=(int)->QMargins&
    // 1: QMargins::operator*=(qreal)->QMargins&
    if (!isReverse
        && PyFloat_Check(pyArg) && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 1; // operator*=(qreal)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // operator*=(int)
    }

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

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

    // Call function/method
    switch (overloadId) {
        case 0: // operator*=(int arg__1)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator*=(int)
                (*cppSelf) *= cppArg0;
            }
            break;
        }
        case 1: // operator*=(qreal arg__1)
        {
            qreal cppArg0;
            pythonToCpp(pyArg, &cppArg0);

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

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

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

static PyObject *Sbk_QMarginsFunc___pos__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.__pos__";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // operator+(QMargins)
            QMargins cppResult = + (*cppSelf);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
        }
    }

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

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

    // Overloaded function decisor
    // 0: QMargins::operator+(QMargins)->QMargins
    // 1: QMargins::operator+(int)->QMargins
    // 2: QMargins::operator+(int)->QMargins
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 2; // operator+(QMargins,int)
    } else if (isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 1; // operator+(int,QMargins)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
        overloadId = 0; // operator+(QMargins,QMargins)
    }

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

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

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


            if (!PyErr_Occurred()) {
                // operator+(QMargins,QMargins)
                QMargins cppResult = (*cppSelf) + (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator+(int lhs)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator+(int,QMargins) [reverse operator]
                QMargins cppResult = cppArg0 + (*cppSelf);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 2: // operator+(int rhs)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator+(QMargins,int)
                QMargins cppResult = (*cppSelf) + cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator+=(QMargins)->QMargins&
    // 1: QMargins::operator+=(int)->QMargins&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 1; // operator+=(int)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
        overloadId = 0; // operator+=(QMargins)
    }

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

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

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


            if (!PyErr_Occurred()) {
                // operator+=(QMargins)
                (*cppSelf) += (*cppArg0);
            }
            break;
        }
        case 1: // operator+=(int arg__1)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

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

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

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

static PyObject *Sbk_QMarginsFunc___neg__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QMargins.__neg__";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // operator-(QMargins)
            QMargins cppResult = - (*cppSelf);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
        }
    }

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

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

    // Overloaded function decisor
    // 0: QMargins::operator-(QMargins)->QMargins
    // 1: QMargins::operator-(int)->QMargins
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 1; // operator-(QMargins,int)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
        overloadId = 0; // operator-(QMargins,QMargins)
    }

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

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

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


            if (!PyErr_Occurred()) {
                // operator-(QMargins,QMargins)
                QMargins cppResult = (*cppSelf) - (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator-(int rhs)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator-(QMargins,int)
                QMargins cppResult = (*cppSelf) - cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator-=(QMargins)->QMargins&
    // 1: QMargins::operator-=(int)->QMargins&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 1; // operator-=(int)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
        overloadId = 0; // operator-=(QMargins)
    }

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

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

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


            if (!PyErr_Occurred()) {
                // operator-=(QMargins)
                (*cppSelf) -= (*cppArg0);
            }
            break;
        }
        case 1: // operator-=(int arg__1)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

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

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator/(int)->QMargins
    // 1: QMargins::operator/(qreal)->QMargins
    if (!isReverse
        && PyFloat_Check(pyArg) && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 1; // operator/(QMargins,qreal)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // operator/(QMargins,int)
    }

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

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

    // Call function/method
    switch (overloadId) {
        case 0: // operator/(int divisor)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator/(QMargins,int)
                QMargins cppResult = (*cppSelf) / cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
        case 1: // operator/(qreal divisor)
        {
            qreal cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator/(QMargins,qreal)
                QMargins cppResult = (*cppSelf) / cppArg0;
                pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
            }
            break;
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QMargins::operator/=(int)->QMargins&
    // 1: QMargins::operator/=(qreal)->QMargins&
    if (!isReverse
        && PyFloat_Check(pyArg) && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), (pyArg)))) {
        overloadId = 1; // operator/=(qreal)
    } else if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // operator/=(int)
    }

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

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

    // Call function/method
    switch (overloadId) {
        case 0: // operator/=(int arg__1)
        {
            int cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (!PyErr_Occurred()) {
                // operator/=(int)
                (*cppSelf) /= cppArg0;
            }
            break;
        }
        case 1: // operator/=(qreal arg__1)
        {
            qreal cppArg0;
            pythonToCpp(pyArg, &cppArg0);

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

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

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

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

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

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

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

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


        if (!PyErr_Occurred()) {
            // operator|(QMargins,QMargins)
            QMargins cppResult = (*cppSelf) | (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], &cppResult);
        }
    }

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

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

// Rich comparison
static PyObject * Sbk_QMargins_richcompare(PyObject *self, PyObject *pyArg, int op)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_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_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
                // operator!=(const QMargins & m2)
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QMargins cppArg0_local;
                ::QMargins *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_QtCoreTypes[SBK_QMARGINS_IDX], (pyArg)))) {
                // operator==(const QMargins & m2)
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QMargins cppArg0_local;
                ::QMargins *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_QMargins_RichComparison_TypeError;
    }

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

}

} // extern "C"

static int Sbk_QMargins_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QMargins_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
extern "C"
{
static PyObject *Sbk_QMargins__repr__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_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_QMargins_Type = nullptr;
static PyTypeObject *Sbk_QMargins_TypeF(void)
{
    return _Sbk_QMargins_Type;
}

static PyType_Slot Sbk_QMargins_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        reinterpret_cast<void *>(Sbk_QMargins__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_QMargins_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QMargins_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_QMargins_richcompare)},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QMargins_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QMargins_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    // type supports number protocol
    {Py_nb_inplace_add, reinterpret_cast<void *>(Sbk_QMarginsFunc___iadd__)},
    {Py_nb_subtract, reinterpret_cast<void *>(Sbk_QMarginsFunc___sub__)},
    {Py_nb_or, reinterpret_cast<void *>(Sbk_QMarginsFunc___or__)},
    {Py_nb_inplace_subtract, reinterpret_cast<void *>(Sbk_QMarginsFunc___isub__)},
    {Py_nb_positive, reinterpret_cast<void *>(Sbk_QMarginsFunc___pos__)},
    {Py_nb_inplace_multiply, reinterpret_cast<void *>(Sbk_QMarginsFunc___imul__)},
    {Py_nb_multiply, reinterpret_cast<void *>(Sbk_QMarginsFunc___mul__)},
    {Py_nb_negative, reinterpret_cast<void *>(Sbk_QMarginsFunc___neg__)},
    {Py_nb_bool, reinterpret_cast<void *>(Sbk_QMargins___nb_bool)},
    {Py_nb_add, reinterpret_cast<void *>(Sbk_QMarginsFunc___add__)},
    {Py_nb_true_divide, reinterpret_cast<void *>(Sbk_QMarginsFunc___div__)},
    // This function is unused in Python 3. We reference it here.
    {0, reinterpret_cast<void *>(Sbk_QMarginsFunc___idiv__)},
    // This list is ending at the first 0 entry.
    // Therefore, we need to put the unused functions at the very end.
    {0, nullptr}
};
static PyType_Spec Sbk_QMargins_spec = {
    "2:PySide6.QtCore.QMargins",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QMargins_slots
};

} //extern "C"


// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QMargins_PTR_CppToPython_QMargins(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 ::QMargins *>(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_QMargins_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

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

// Python to C++ copy conversion.
static void QMargins_PythonToCpp_QMargins_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QMargins *>(cppOut) = *reinterpret_cast< ::QMargins *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QMargins_PythonToCpp_QMargins_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QMargins_TypeF())))
        return QMargins_PythonToCpp_QMargins_COPY;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QMargins_SignatureStrings[] = {
    "2:PySide6.QtCore.QMargins(self)",
    "1:PySide6.QtCore.QMargins(self,QMargins:PySide6.QtCore.QMargins)",
    "0:PySide6.QtCore.QMargins(self,left:int,top:int,right:int,bottom:int)",
    "PySide6.QtCore.QMargins.bottom(self)->int",
    "PySide6.QtCore.QMargins.isNull(self)->bool",
    "PySide6.QtCore.QMargins.left(self)->int",
    "PySide6.QtCore.QMargins.right(self)->int",
    "PySide6.QtCore.QMargins.setBottom(self,bottom:int)",
    "PySide6.QtCore.QMargins.setLeft(self,left:int)",
    "PySide6.QtCore.QMargins.setRight(self,right:int)",
    "PySide6.QtCore.QMargins.setTop(self,top:int)",
    "PySide6.QtCore.QMargins.top(self)->int",
    "PySide6.QtCore.QMargins.__copy__()",
    "3:PySide6.QtCore.QMargins.__mul__(self,factor:int)->PySide6.QtCore.QMargins",
    "2:PySide6.QtCore.QMargins.__mul__(self,factor:int)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__mul__(self,factor:qreal)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__mul__(self,factor:qreal)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__imul__(self,arg__1:int)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__imul__(self,arg__1:qreal)->PySide6.QtCore.QMargins",
    "PySide6.QtCore.QMargins.__pos__(self)->PySide6.QtCore.QMargins",
    "2:PySide6.QtCore.QMargins.__add__(self,m2:PySide6.QtCore.QMargins)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__add__(self,lhs:int)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__add__(self,rhs:int)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__iadd__(self,margins:PySide6.QtCore.QMargins)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__iadd__(self,arg__1:int)->PySide6.QtCore.QMargins",
    "PySide6.QtCore.QMargins.__neg__(self)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__sub__(self,m2:PySide6.QtCore.QMargins)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__sub__(self,rhs:int)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__isub__(self,margins:PySide6.QtCore.QMargins)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__isub__(self,arg__1:int)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__div__(self,divisor:int)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__div__(self,divisor:qreal)->PySide6.QtCore.QMargins",
    "1:PySide6.QtCore.QMargins.__idiv__(self,arg__1:int)->PySide6.QtCore.QMargins",
    "0:PySide6.QtCore.QMargins.__idiv__(self,arg__1:qreal)->PySide6.QtCore.QMargins",
    "PySide6.QtCore.QMargins.__or__(self,m2:PySide6.QtCore.QMargins)->PySide6.QtCore.QMargins",
    nullptr}; // Sentinel

void init_QMargins(PyObject *module)
{
    _Sbk_QMargins_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QMargins",
        "QMargins",
        &Sbk_QMargins_spec,
        &Shiboken::callCppDestructor< ::QMargins >,
        0,
        0,
        0);
    auto *pyType = Sbk_QMargins_TypeF(); // references _Sbk_QMargins_Type
    InitSignatureStrings(pyType, QMargins_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QMargins_Type), Sbk_QMargins_PropertyStrings);
    SbkPySide6_QtCoreTypes[SBK_QMARGINS_IDX]
        = Sbk_QMargins_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QMargins_TypeF(),
        QMargins_PythonToCpp_QMargins_PTR,
        is_QMargins_PythonToCpp_QMargins_PTR_Convertible,
        QMargins_PTR_CppToPython_QMargins,
        QMargins_COPY_CppToPython_QMargins);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QMargins_PythonToCpp_QMargins_COPY,
        is_QMargins_PythonToCpp_QMargins_COPY_Convertible);

    qRegisterMetaType< ::QMargins >("QMargins");
}
