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

// inner classes

#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_QIODeviceBase_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< ::QIODeviceBase >()))
        return -1;

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

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "QIODeviceBase", 0, 1, &(pyArgs[0])))
        return -1;


    // Overloaded function decisor
    // 0: QIODeviceBase::QIODeviceBase()
    // 1: QIODeviceBase::QIODeviceBase(QIODeviceBase)
    if (numArgs == 0) {
        overloadId = 0; // QIODeviceBase()
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_IDX], (pyArgs[0])))) {
        overloadId = 1; // QIODeviceBase(QIODeviceBase)
    }

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

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

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


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

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

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


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

static PyMethodDef Sbk_QIODeviceBase_methods[] = {

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

} // extern "C"

static int Sbk_QIODeviceBase_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QIODeviceBase_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static PyTypeObject *_Sbk_QIODeviceBase_Type = nullptr;
static PyTypeObject *Sbk_QIODeviceBase_TypeF(void)
{
    return _Sbk_QIODeviceBase_Type;
}

static PyType_Slot Sbk_QIODeviceBase_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        nullptr},
    {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_QIODeviceBase_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QIODeviceBase_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QIODeviceBase_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QIODeviceBase_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QIODeviceBase_spec = {
    "2:PySide6.QtCore.QIODeviceBase",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QIODeviceBase_slots
};

} //extern "C"

PyObject *SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___and__(PyObject *self, PyObject *pyArg)
{
    ::QIODeviceBase::OpenMode cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QIODeviceBase::OpenMode>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QIODeviceBase::OpenMode>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf & cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___or__(PyObject *self, PyObject *pyArg)
{
    ::QIODeviceBase::OpenMode cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QIODeviceBase::OpenMode>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QIODeviceBase::OpenMode>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf | cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___xor__(PyObject *self, PyObject *pyArg)
{
    ::QIODeviceBase::OpenMode cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QIODeviceBase::OpenMode>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QIODeviceBase::OpenMode>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf ^ cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___invert__(PyObject *self, PyObject *pyArg)
{
    ::QIODeviceBase::OpenMode cppSelf;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, self, &cppSelf);
    ::QIODeviceBase::OpenMode cppResult = ~cppSelf;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, &cppResult);
}

static PyObject *SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag_long(PyObject *self)
{
    int val;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, self, &val);
    return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &val);
}
static int SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag__nonzero(PyObject *self)
{
    int val;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))->converter, self, &val);
    return val != 0;
}

static PyType_Slot SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag_number_slots[] = {
    {Py_nb_bool,    reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag__nonzero)},
    {Py_nb_invert,  reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___invert__)},
    {Py_nb_and,     reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___and__)},
    {Py_nb_xor,     reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___xor__)},
    {Py_nb_or,      reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag___or__)},
    {Py_nb_int,     reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag_long)},
    {Py_nb_index,   reinterpret_cast<void *>(SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag_long)},
    {0, nullptr} // sentinel
};



// Type conversion functions.

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

}
static PythonToCppFunc is_QIODeviceBase_OpenModeFlag_PythonToCpp_QIODeviceBase_OpenModeFlag_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX]))
        return QIODeviceBase_OpenModeFlag_PythonToCpp_QIODeviceBase_OpenModeFlag;
    return {};
}
static PyObject *QIODeviceBase_OpenModeFlag_CppToPython_QIODeviceBase_OpenModeFlag(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QIODeviceBase::OpenModeFlag *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX], castCppIn);

}

static void QFlags_QIODeviceBase_OpenModeFlag__PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QIODeviceBase::OpenModeFlag> *>(cppOut) =
        ::QFlags<QIODeviceBase::OpenModeFlag>(QFlag(int(PySide::QFlags::getValue(reinterpret_cast<PySideQFlagsObject *>(pyIn)))));

}
static PythonToCppFunc is_QFlags_QIODeviceBase_OpenModeFlag__PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]))
        return QFlags_QIODeviceBase_OpenModeFlag__PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_;
    return {};
}
static PyObject *QFlags_QIODeviceBase_OpenModeFlag__CppToPython_QFlags_QIODeviceBase_OpenModeFlag_(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QFlags<QIODeviceBase::OpenModeFlag> *>(cppIn));
    return reinterpret_cast<PyObject *>(PySide::QFlags::newObject(castCppIn, SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]));

}

static void QIODeviceBase_OpenModeFlag_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QIODeviceBase::OpenModeFlag> *>(cppOut) =
        ::QFlags<QIODeviceBase::OpenModeFlag>(QFlag(int(Shiboken::Enum::getValue(pyIn))));

}
static PythonToCppFunc is_QIODeviceBase_OpenModeFlag_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX]))
        return QIODeviceBase_OpenModeFlag_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_;
    return {};
}
static void number_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_(PyObject *pyIn, void *cppOut)
{
    Shiboken::AutoDecRef pyLong(PyNumber_Long(pyIn));
    *reinterpret_cast<::QFlags<QIODeviceBase::OpenModeFlag> *>(cppOut) =
        ::QFlags<QIODeviceBase::OpenModeFlag>(QFlag(int(PyLong_AsLong(pyLong.object()))));

}
static PythonToCppFunc is_number_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible(PyObject *pyIn)
{
    if (PyNumber_Check(pyIn) && PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX]))
        return number_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_;
    return {};
}
// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QIODeviceBase_PythonToCpp_QIODeviceBase_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QIODeviceBase_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QIODeviceBase_PythonToCpp_QIODeviceBase_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QIODeviceBase_TypeF())))
        return QIODeviceBase_PythonToCpp_QIODeviceBase_PTR;
    return {};
}

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

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

// Python to C++ copy conversion.
static void QIODeviceBase_PythonToCpp_QIODeviceBase_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QIODeviceBase *>(cppOut) = *reinterpret_cast< ::QIODeviceBase *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QIODeviceBase_PythonToCpp_QIODeviceBase_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QIODeviceBase_TypeF())))
        return QIODeviceBase_PythonToCpp_QIODeviceBase_COPY;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QIODeviceBase_SignatureStrings[] = {
    "1:PySide6.QtCore.QIODeviceBase(self)",
    "0:PySide6.QtCore.QIODeviceBase(self,QIODeviceBase:PySide6.QtCore.QIODeviceBase)",
    "PySide6.QtCore.QIODeviceBase.__copy__()",
    nullptr}; // Sentinel

void init_QIODeviceBase(PyObject *module)
{
    _Sbk_QIODeviceBase_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QIODeviceBase",
        "QIODeviceBase",
        &Sbk_QIODeviceBase_spec,
        &Shiboken::callCppDestructor< ::QIODeviceBase >,
        0,
        0,
        0);
    auto *pyType = Sbk_QIODeviceBase_TypeF(); // references _Sbk_QIODeviceBase_Type
    InitSignatureStrings(pyType, QIODeviceBase_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QIODeviceBase_Type), Sbk_QIODeviceBase_PropertyStrings);
    SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_IDX]
        = Sbk_QIODeviceBase_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QIODeviceBase_TypeF(),
        QIODeviceBase_PythonToCpp_QIODeviceBase_PTR,
        is_QIODeviceBase_PythonToCpp_QIODeviceBase_PTR_Convertible,
        QIODeviceBase_PTR_CppToPython_QIODeviceBase,
        QIODeviceBase_COPY_CppToPython_QIODeviceBase);

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

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

    // Initialization of enums.

    // Initialization of enum 'OpenModeFlag'.
    SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX] = PySide::QFlags::create("2:PySide6.QtCore.QIODeviceBase.OpenMode", SbkPySide6_QtCore_QIODeviceBase_OpenModeFlag_number_slots);
    SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QIODeviceBase_TypeF(),
        "OpenModeFlag",
        "2:PySide6.QtCore.QIODeviceBase.OpenModeFlag",
        "QIODeviceBase::OpenModeFlag",
        SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX]);
    if (!SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "NotOpen", (long) QIODeviceBase::OpenModeFlag::NotOpen))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "ReadOnly", (long) QIODeviceBase::OpenModeFlag::ReadOnly))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "WriteOnly", (long) QIODeviceBase::OpenModeFlag::WriteOnly))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "ReadWrite", (long) QIODeviceBase::OpenModeFlag::ReadWrite))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "Append", (long) QIODeviceBase::OpenModeFlag::Append))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "Truncate", (long) QIODeviceBase::OpenModeFlag::Truncate))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "Text", (long) QIODeviceBase::OpenModeFlag::Text))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "Unbuffered", (long) QIODeviceBase::OpenModeFlag::Unbuffered))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "NewOnly", (long) QIODeviceBase::OpenModeFlag::NewOnly))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
        Sbk_QIODeviceBase_TypeF(), "ExistingOnly", (long) QIODeviceBase::OpenModeFlag::ExistingOnly))
        return;
    // Register converter for enum 'QIODeviceBase::OpenModeFlag'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX],
            QIODeviceBase_OpenModeFlag_CppToPython_QIODeviceBase_OpenModeFlag);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QIODeviceBase_OpenModeFlag_PythonToCpp_QIODeviceBase_OpenModeFlag,
            is_QIODeviceBase_OpenModeFlag_PythonToCpp_QIODeviceBase_OpenModeFlag_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtCoreTypes[SBK_QIODEVICEBASE_OPENMODEFLAG_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QIODeviceBase::OpenModeFlag");
        Shiboken::Conversions::registerConverterName(converter, "OpenModeFlag");
    }
    // Register converter for flag 'QFlags<QIODeviceBase::OpenModeFlag>'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX],
            QFlags_QIODeviceBase_OpenModeFlag__CppToPython_QFlags_QIODeviceBase_OpenModeFlag_);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QIODeviceBase_OpenModeFlag_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_,
            is_QIODeviceBase_OpenModeFlag_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QFlags_QIODeviceBase_OpenModeFlag__PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_,
            is_QFlags_QIODeviceBase_OpenModeFlag__PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            number_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag_,
            is_number_PythonToCpp_QFlags_QIODeviceBase_OpenModeFlag__Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QIODEVICEBASE_OPENMODEFLAG_IDX], converter, true);
        Shiboken::Conversions::registerConverterName(converter, "QIODeviceBase::OpenMode");
        Shiboken::Conversions::registerConverterName(converter, "OpenMode");
        Shiboken::Conversions::registerConverterName(converter, "QFlags<QIODeviceBase::OpenModeFlag>");
    }
    // End of 'OpenModeFlag' enum/flags.

    qRegisterMetaType< ::QIODeviceBase >("QIODeviceBase");
    qRegisterMetaType< ::QIODeviceBase::OpenModeFlag >("QIODeviceBase::OpenModeFlag");
    qRegisterMetaType< ::QIODeviceBase::OpenMode >("QIODeviceBase::OpenMode");
}
