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

// main header
#include "qdbuserror_wrapper.h"

// inner classes

// Extra includes
#include <QtDBus/qdbuserror.h>
#include <QtDBus/qdbusmessage.h>
#include <qobject.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_QDBusError_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< ::QDBusError >()))
        return -1;

    ::QDBusError *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.__init__";
    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, "QDBusError", 0, 2, &(pyArgs[0]), &(pyArgs[1])))
        return -1;


    // Overloaded function decisor
    // 0: QDBusError::QDBusError()
    // 1: QDBusError::QDBusError(QDBusError::ErrorType,QString)
    // 2: QDBusError::QDBusError(QDBusError)
    // 3: QDBusError::QDBusError(QDBusMessage)
    if (numArgs == 0) {
        overloadId = 0; // QDBusError()
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtDBusTypes[SBK_QDBUSMESSAGE_IDX], (pyArgs[0])))) {
        overloadId = 3; // QDBusError(QDBusMessage)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], (pyArgs[0])))) {
        overloadId = 2; // QDBusError(QDBusError)
    } else if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX]))->converter, (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) {
        overloadId = 1; // QDBusError(QDBusError::ErrorType,QString)
    }

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

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

            if (!PyErr_Occurred()) {
                // QDBusError()
                cptr = new ::QDBusError();
            }
            break;
        }
        case 1: // QDBusError(QDBusError::ErrorType error, const QString & message)
        {
            ::QDBusError::ErrorType cppArg0{QDBusError::NoError};
            pythonToCpp[0](pyArgs[0], &cppArg0);
            ::QString cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

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


            if (!PyErr_Occurred()) {
                // QDBusError(QDBusError)
                cptr = new ::QDBusError(*cppArg0);
            }
            break;
        }
        case 3: // QDBusError(const QDBusMessage & msg)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QDBusMessage *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!PyErr_Occurred()) {
                // QDBusError(QDBusMessage)
                cptr = new ::QDBusError(*cppArg0);
            }
            break;
        }
    }

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

static PyObject *Sbk_QDBusErrorFunc_errorString(PyObject *self, PyObject *pyArg)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.errorString";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: static QDBusError::errorString(QDBusError::ErrorType)->QString
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX]))->converter, (pyArg)))) {
        overloadId = 0; // errorString(QDBusError::ErrorType)
    }

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

    // Call function/method
    {
        ::QDBusError::ErrorType cppArg0{QDBusError::NoError};
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // errorString(QDBusError::ErrorType)
            QString cppResult = ::QDBusError::errorString(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult);
        }
    }

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

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

static PyObject *Sbk_QDBusErrorFunc_isValid(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.isValid";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QDBusErrorFunc_message(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.message";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // message()const
            QString cppResult = const_cast<const ::QDBusError *>(cppSelf)->message();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult);
        }
    }

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

static PyObject *Sbk_QDBusErrorFunc_name(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.name";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // name()const
            QString cppResult = const_cast<const ::QDBusError *>(cppSelf)->name();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult);
        }
    }

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

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

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

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

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


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

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

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

static PyObject *Sbk_QDBusErrorFunc_type(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtDBus.QDBusError.type";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // type()const
            QDBusError::ErrorType cppResult = const_cast<const ::QDBusError *>(cppSelf)->type();
            pyResult = Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX]))->converter, &cppResult);
        }
    }

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

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


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

static PyMethodDef Sbk_QDBusError_methods[] = {
    {"errorString", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_errorString), METH_O|METH_STATIC},
    {"isValid", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_isValid), METH_NOARGS},
    {"message", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_message), METH_NOARGS},
    {"name", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_name), METH_NOARGS},
    {"swap", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_swap), METH_O},
    {"type", reinterpret_cast<PyCFunction>(Sbk_QDBusErrorFunc_type), METH_NOARGS},

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

} // extern "C"

static int Sbk_QDBusError_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QDBusError_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
extern "C"
{
static PyObject *Sbk_QDBusError__repr__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_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_QDBusError_Type = nullptr;
static PyTypeObject *Sbk_QDBusError_TypeF(void)
{
    return _Sbk_QDBusError_Type;
}

static PyType_Slot Sbk_QDBusError_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        reinterpret_cast<void *>(Sbk_QDBusError__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_QDBusError_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QDBusError_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QDBusError_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QDBusError_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QDBusError_spec = {
    "2:PySide6.QtDBus.QDBusError",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QDBusError_slots
};

} //extern "C"


// Type conversion functions.

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

}
static PythonToCppFunc is_QDBusError_ErrorType_PythonToCpp_QDBusError_ErrorType_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX]))
        return QDBusError_ErrorType_PythonToCpp_QDBusError_ErrorType;
    return {};
}
static PyObject *QDBusError_ErrorType_CppToPython_QDBusError_ErrorType(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QDBusError::ErrorType *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX], castCppIn);

}

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

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

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

// Python to C++ copy conversion.
static void QDBusError_PythonToCpp_QDBusError_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QDBusError *>(cppOut) = *reinterpret_cast< ::QDBusError *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QDBusError_PythonToCpp_QDBusError_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QDBusError_TypeF())))
        return QDBusError_PythonToCpp_QDBusError_COPY;
    return {};
}

// Implicit conversions.
static void constQDBusMessageREF_PythonToCpp_QDBusError(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QDBusError *>(cppOut) = ::QDBusError( *reinterpret_cast< ::QDBusMessage *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtDBusTypes[SBK_QDBUSMESSAGE_IDX], reinterpret_cast<SbkObject *>(pyIn))));
}
static PythonToCppFunc is_constQDBusMessageREF_PythonToCpp_QDBusError_Convertible(PyObject *pyIn)
{
    if (SbkObject_TypeCheck(SbkPySide6_QtDBusTypes[SBK_QDBUSMESSAGE_IDX], pyIn))
        return constQDBusMessageREF_PythonToCpp_QDBusError;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QDBusError_SignatureStrings[] = {
    "3:PySide6.QtDBus.QDBusError(self)",
    "2:PySide6.QtDBus.QDBusError(self,error:PySide6.QtDBus.QDBusError.ErrorType,message:QString)",
    "1:PySide6.QtDBus.QDBusError(self,other:typing.Union[PySide6.QtDBus.QDBusError, PySide6.QtDBus.QDBusMessage])",
    "0:PySide6.QtDBus.QDBusError(self,msg:PySide6.QtDBus.QDBusMessage)",
    "PySide6.QtDBus.QDBusError.errorString(error:PySide6.QtDBus.QDBusError.ErrorType)->QString",
    "PySide6.QtDBus.QDBusError.isValid(self)->bool",
    "PySide6.QtDBus.QDBusError.message(self)->QString",
    "PySide6.QtDBus.QDBusError.name(self)->QString",
    "PySide6.QtDBus.QDBusError.swap(self,other:typing.Union[PySide6.QtDBus.QDBusError, PySide6.QtDBus.QDBusMessage])",
    "PySide6.QtDBus.QDBusError.type(self)->PySide6.QtDBus.QDBusError.ErrorType",
    "PySide6.QtDBus.QDBusError.__copy__()",
    nullptr}; // Sentinel

void init_QDBusError(PyObject *module)
{
    _Sbk_QDBusError_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QDBusError",
        "QDBusError",
        &Sbk_QDBusError_spec,
        &Shiboken::callCppDestructor< ::QDBusError >,
        0,
        0,
        0);
    auto *pyType = Sbk_QDBusError_TypeF(); // references _Sbk_QDBusError_Type
    InitSignatureStrings(pyType, QDBusError_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QDBusError_Type), Sbk_QDBusError_PropertyStrings);
    SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_IDX]
        = Sbk_QDBusError_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QDBusError_TypeF(),
        QDBusError_PythonToCpp_QDBusError_PTR,
        is_QDBusError_PythonToCpp_QDBusError_PTR_Convertible,
        QDBusError_PTR_CppToPython_QDBusError,
        QDBusError_COPY_CppToPython_QDBusError);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QDBusError_PythonToCpp_QDBusError_COPY,
        is_QDBusError_PythonToCpp_QDBusError_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        constQDBusMessageREF_PythonToCpp_QDBusError,
        is_constQDBusMessageREF_PythonToCpp_QDBusError_Convertible);

    // Initialization of enums.

    // Initialization of enum 'ErrorType'.
    SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QDBusError_TypeF(),
        "ErrorType",
        "2:PySide6.QtDBus.QDBusError.ErrorType",
        "QDBusError::ErrorType");
    if (!SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NoError", (long) QDBusError::ErrorType::NoError))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "Other", (long) QDBusError::ErrorType::Other))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "Failed", (long) QDBusError::ErrorType::Failed))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NoMemory", (long) QDBusError::ErrorType::NoMemory))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "ServiceUnknown", (long) QDBusError::ErrorType::ServiceUnknown))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NoReply", (long) QDBusError::ErrorType::NoReply))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "BadAddress", (long) QDBusError::ErrorType::BadAddress))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NotSupported", (long) QDBusError::ErrorType::NotSupported))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "LimitsExceeded", (long) QDBusError::ErrorType::LimitsExceeded))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "AccessDenied", (long) QDBusError::ErrorType::AccessDenied))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NoServer", (long) QDBusError::ErrorType::NoServer))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "Timeout", (long) QDBusError::ErrorType::Timeout))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "NoNetwork", (long) QDBusError::ErrorType::NoNetwork))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "AddressInUse", (long) QDBusError::ErrorType::AddressInUse))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "Disconnected", (long) QDBusError::ErrorType::Disconnected))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidArgs", (long) QDBusError::ErrorType::InvalidArgs))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "UnknownMethod", (long) QDBusError::ErrorType::UnknownMethod))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "TimedOut", (long) QDBusError::ErrorType::TimedOut))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidSignature", (long) QDBusError::ErrorType::InvalidSignature))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "UnknownInterface", (long) QDBusError::ErrorType::UnknownInterface))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "UnknownObject", (long) QDBusError::ErrorType::UnknownObject))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "UnknownProperty", (long) QDBusError::ErrorType::UnknownProperty))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "PropertyReadOnly", (long) QDBusError::ErrorType::PropertyReadOnly))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InternalError", (long) QDBusError::ErrorType::InternalError))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidService", (long) QDBusError::ErrorType::InvalidService))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidObjectPath", (long) QDBusError::ErrorType::InvalidObjectPath))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidInterface", (long) QDBusError::ErrorType::InvalidInterface))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "InvalidMember", (long) QDBusError::ErrorType::InvalidMember))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
        Sbk_QDBusError_TypeF(), "LastErrorType", (long) QDBusError::ErrorType::LastErrorType))
        return;
    // Register converter for enum 'QDBusError::ErrorType'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX],
            QDBusError_ErrorType_CppToPython_QDBusError_ErrorType);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QDBusError_ErrorType_PythonToCpp_QDBusError_ErrorType,
            is_QDBusError_ErrorType_PythonToCpp_QDBusError_ErrorType_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtDBusTypes[SBK_QDBUSERROR_ERRORTYPE_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QDBusError::ErrorType");
        Shiboken::Conversions::registerConverterName(converter, "ErrorType");
    }
    // End of 'ErrorType' enum.

    qRegisterMetaType< ::QDBusError >("QDBusError");
    qRegisterMetaType< ::QDBusError::ErrorType >("QDBusError::ErrorType");
}
