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

// inner classes

// Extra includes
#include <qbitarray.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_QBitArray_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< ::QBitArray >()))
        return -1;

    ::QBitArray *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.__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 (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QBitArray_Init_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:QBitArray", &(pyArgs[0]), &(pyArgs[1])))
        return -1;


    // Overloaded function decisor
    // 0: QBitArray::QBitArray()
    // 1: QBitArray::QBitArray(QBitArray)
    // 2: QBitArray::QBitArray(qsizetype,bool)
    if (numArgs == 0) {
        overloadId = 0; // QBitArray()
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 2; // QBitArray(qsizetype,bool)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1])))) {
            overloadId = 2; // QBitArray(qsizetype,bool)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], (pyArgs[0])))) {
        overloadId = 1; // QBitArray(QBitArray)
    }

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

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

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


            if (!PyErr_Occurred()) {
                // QBitArray(QBitArray)
                cptr = new ::QBitArray(*cppArg0);
            }
            break;
        }
        case 2: // QBitArray(qsizetype size, bool val)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_val = Shiboken::String::createStaticString("val");
                if (PyDict_Contains(kwds, key_val)) {
                    value = PyDict_GetItem(kwds, key_val);
                    if (value && pyArgs[1]) {
                        errInfo.reset(key_val);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QBitArray_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[1] = value;
                        if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1]))))
                            goto Sbk_QBitArray_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_val);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QBitArray_Init_TypeError;
                }
            }
            qsizetype cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            bool cppArg1 = false;
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QBitArray(qsizetype,bool)
                cptr = new ::QBitArray(cppArg0, cppArg1);
            }
            break;
        }
    }

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

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

    // Overloaded function decisor
    // 0: QBitArray::at(qsizetype)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // at(qsizetype)const
    }

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

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

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

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // bits()const
            const char * cppResult = const_cast<const ::QBitArray *>(cppSelf)->bits();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<const char *>(), cppResult);
        }
    }

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // clear()
            cppSelf->clear();
        }
    }

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

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

    // Overloaded function decisor
    // 0: QBitArray::clearBit(qsizetype)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // clearBit(qsizetype)
    }

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

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

        if (!PyErr_Occurred()) {
            // clearBit(qsizetype)
            cppSelf->clearBit(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QBitArrayFunc_count(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.count";
    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, "count", 0, 1, &(pyArgs[0])))
        return {};


    // Overloaded function decisor
    // 0: QBitArray::count()const->qsizetype
    // 1: QBitArray::count(bool)const->qsizetype
    if (numArgs == 0) {
        overloadId = 0; // count()const
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[0])))) {
        overloadId = 1; // count(bool)const
    }

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

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

            if (!PyErr_Occurred()) {
                // count()const
                qsizetype cppResult = const_cast<const ::QBitArray *>(cppSelf)->count();
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), &cppResult);
            }
            break;
        }
        case 1: // count(bool on) const
        {
            bool cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

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

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

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

static PyObject *Sbk_QBitArrayFunc_fill(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.fill";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[3];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0, 0};

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

    if (!PyArg_ParseTuple(args, "|OOO:fill", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2])))
        return {};


    // Overloaded function decisor
    // 0: QBitArray::fill(bool,qsizetype,qsizetype)
    // 1: QBitArray::fill(bool,qsizetype)->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 1; // fill(bool,qsizetype)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[1])))) {
            if (numArgs == 2) {
                overloadId = 1; // fill(bool,qsizetype)
            } else if (numArgs == 3
                && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[2])))) {
                overloadId = 0; // fill(bool,qsizetype,qsizetype)
            }
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // fill(bool val, qsizetype first, qsizetype last)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QBitArrayFunc_fill_TypeError;
            }
            bool cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            qsizetype cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);
            qsizetype cppArg2;
            pythonToCpp[2](pyArgs[2], &cppArg2);

            if (!PyErr_Occurred()) {
                // fill(bool,qsizetype,qsizetype)
                cppSelf->fill(cppArg0, cppArg1, cppArg2);
                pyResult = Py_None;
                Py_INCREF(Py_None);
            }
            break;
        }
        case 1: // fill(bool val, qsizetype size)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_size = Shiboken::String::createStaticString("size");
                if (PyDict_Contains(kwds, key_size)) {
                    value = PyDict_GetItem(kwds, key_size);
                    if (value && pyArgs[1]) {
                        errInfo.reset(key_size);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QBitArrayFunc_fill_TypeError;
                    }
                    if (value) {
                        pyArgs[1] = value;
                        if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[1]))))
                            goto Sbk_QBitArrayFunc_fill_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_size);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QBitArrayFunc_fill_TypeError;
                }
            }
            bool cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            qsizetype cppArg1 = -1;
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // fill(bool,qsizetype)
                bool cppResult = cppSelf->fill(cppArg0, cppArg1);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            }
            break;
        }
    }

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

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

static PyObject *Sbk_QBitArrayFunc_fromBits(PyObject *self, PyObject *args)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.fromBits";
    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, "fromBits", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: static QBitArray::fromBits(const char*,qsizetype)->QBitArray
    if (numArgs == 2
        && Shiboken::String::check(pyArgs[0]) && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<const char *>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[1])))) {
        overloadId = 0; // fromBits(const char*,qsizetype)
    }

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

    // Call function/method
    {
        const char* cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        qsizetype cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // fromBits(const char*,qsizetype)
            QBitArray cppResult = ::QBitArray::fromBits(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], &cppResult);
        }
    }

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Overloaded function decisor
    // 0: QBitArray::resize(qsizetype)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // resize(qsizetype)
    }

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

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

        if (!PyErr_Occurred()) {
            // resize(qsizetype)
            cppSelf->resize(cppArg0);
        }
    }

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

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

static PyObject *Sbk_QBitArrayFunc_setBit(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.setBit";
    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, "setBit", 1, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QBitArray::setBit(qsizetype)
    // 1: QBitArray::setBit(qsizetype,bool)
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // setBit(qsizetype)
        } else if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1])))) {
            overloadId = 1; // setBit(qsizetype,bool)
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // setBit(qsizetype i)
        {
            qsizetype cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!PyErr_Occurred()) {
                // setBit(qsizetype)
                cppSelf->setBit(cppArg0);
            }
            break;
        }
        case 1: // setBit(qsizetype i, bool val)
        {
            qsizetype cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            bool cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // setBit(qsizetype,bool)
                cppSelf->setBit(cppArg0, cppArg1);
            }
            break;
        }
    }

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

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

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

    // Call function/method
    {

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

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

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

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

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

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


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

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

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

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

    // Overloaded function decisor
    // 0: QBitArray::testBit(qsizetype)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // testBit(qsizetype)const
    }

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

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

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

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

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

static PyObject *Sbk_QBitArrayFunc_toUInt32(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtCore.QBitArray.toUInt32";
    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 (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QBitArrayFunc_toUInt32_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QBitArrayFunc_toUInt32_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:toUInt32", &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QBitArray::toUInt32(QSysInfo::Endian,bool*)const->quint32
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QSYSINFO_ENDIAN_IDX]))->converter, (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // toUInt32(QSysInfo::Endian,bool*)const
        } else if (numArgs >= 2
            && PyBool_Check(pyArgs[1]) && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1])))) {
            overloadId = 0; // toUInt32(QSysInfo::Endian,bool*)const
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_ok = Shiboken::String::createStaticString("ok");
            if (PyDict_Contains(kwds, key_ok)) {
                value = PyDict_GetItem(kwds, key_ok);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_ok);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QBitArrayFunc_toUInt32_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1]))))
                        goto Sbk_QBitArrayFunc_toUInt32_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_ok);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QBitArrayFunc_toUInt32_TypeError;
            }
        }
        ::QSysInfo::Endian cppArg0{QSysInfo::BigEndian};
        pythonToCpp[0](pyArgs[0], &cppArg0);
        bool *cppArg1 = nullptr;
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // toUInt32(QSysInfo::Endian,bool*)const
            quint32 cppResult = const_cast<const ::QBitArray *>(cppSelf)->toUInt32(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<quint32>(), &cppResult);
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QBitArray::toggleBit(qsizetype)->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // toggleBit(qsizetype)
    }

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

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

        if (!PyErr_Occurred()) {
            // toggleBit(qsizetype)
            bool cppResult = cppSelf->toggleBit(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QBitArray::truncate(qsizetype)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), (pyArg)))) {
        overloadId = 0; // truncate(qsizetype)
    }

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

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

        if (!PyErr_Occurred()) {
            // truncate(qsizetype)
            cppSelf->truncate(cppArg0);
        }
    }

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

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

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


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

static PyMethodDef Sbk_QBitArray_methods[] = {
    {"at", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_at), METH_O},
    {"bits", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_bits), METH_NOARGS},
    {"clear", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_clear), METH_NOARGS},
    {"clearBit", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_clearBit), METH_O},
    {"count", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_count), METH_VARARGS},
    {"fill", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_fill), METH_VARARGS|METH_KEYWORDS},
    {"fromBits", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_fromBits), METH_VARARGS|METH_STATIC},
    {"isEmpty", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_isEmpty), METH_NOARGS},
    {"isNull", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_isNull), METH_NOARGS},
    {"resize", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_resize), METH_O},
    {"setBit", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_setBit), METH_VARARGS},
    {"size", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_size), METH_NOARGS},
    {"swap", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_swap), METH_O},
    {"testBit", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_testBit), METH_O},
    {"toUInt32", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_toUInt32), METH_VARARGS|METH_KEYWORDS},
    {"toggleBit", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_toggleBit), METH_O},
    {"truncate", reinterpret_cast<PyCFunction>(Sbk_QBitArrayFunc_truncate), METH_O},

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


        if (!PyErr_Occurred()) {
            // operator&=(QBitArray)
            (*cppSelf) &= (*cppArg0);
        }
    }

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // operator~()const
            QBitArray cppResult = ~ (*cppSelf);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], &cppResult);
        }
    }

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

Py_ssize_t Sbk_QBitArrayFunc___len__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    // Begin code injection
    // ========================================================================
    // START of custom code block [file: ../glue/qtcore.cpp (qbitarray-len)]
    return cppSelf->size();
    // END of custom code block [file: ../glue/qtcore.cpp (qbitarray-len)]
    // ========================================================================
    // End of code injection

}

PyObject* Sbk_QBitArrayFunc___getitem__(PyObject *self, Py_ssize_t _i)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    // Begin code injection
    // ========================================================================
    // START of custom code block [file: ../glue/qtcore.cpp (qbitarray-getitem)]
    if (_i < 0 || _i >= cppSelf->size()) {
        PyErr_SetString(PyExc_IndexError, "index out of bounds");
        return 0;
    }
    bool ret = cppSelf->at(_i);
    return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &ret);
    // END of custom code block [file: ../glue/qtcore.cpp (qbitarray-getitem)]
    // ========================================================================
    // End of code injection

}

int Sbk_QBitArrayFunc___setitem__(PyObject *self, Py_ssize_t _i, PyObject *_value)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    // Begin code injection
    // ========================================================================
    // START of custom code block [file: ../glue/qtcore.cpp (qbitarray-setitem)]
    PyObject *args = Py_BuildValue("(iiO)", _i, 1, _value);
    PyObject *result = Sbk_QBitArrayFunc_setBit(self, args);
    Py_DECREF(args);
    Py_XDECREF(result);
    return !result ? -1 : 0;
    // END of custom code block [file: ../glue/qtcore.cpp (qbitarray-setitem)]
    // ========================================================================
    // End of code injection

}

// Rich comparison
static PyObject * Sbk_QBitArray_richcompare(PyObject *self, PyObject *pyArg, int op)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_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_QBITARRAY_IDX], (pyArg)))) {
                // operator!=(const QBitArray & other) const
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QBitArray cppArg0_local;
                ::QBitArray *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_QBITARRAY_IDX], (pyArg)))) {
                // operator==(const QBitArray & other) const
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QBitArray cppArg0_local;
                ::QBitArray *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_QBitArray_RichComparison_TypeError;
    }

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

}

} // extern "C"

static Py_hash_t Sbk_QBitArray_HashFunc(PyObject *self) {
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    return Py_hash_t(qHash(*cppSelf));
}

static int Sbk_QBitArray_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QBitArray_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
extern "C"
{
static PyObject *Sbk_QBitArray__repr__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_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_QBitArray_Type = nullptr;
static PyTypeObject *Sbk_QBitArray_TypeF(void)
{
    return _Sbk_QBitArray_Type;
}

static PyType_Slot Sbk_QBitArray_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        reinterpret_cast<void *>(Sbk_QBitArray__repr__)},
    {Py_tp_hash,        reinterpret_cast<void *>(&Sbk_QBitArray_HashFunc)},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    nullptr},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QBitArray_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QBitArray_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_QBitArray_richcompare)},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QBitArray_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QBitArray_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    // type supports sequence protocol
    {Py_sq_ass_item, reinterpret_cast<void *>(&Sbk_QBitArrayFunc___setitem__)},
    {Py_sq_length, reinterpret_cast<void *>(&Sbk_QBitArrayFunc___len__)},
    {Py_sq_item, reinterpret_cast<void *>(&Sbk_QBitArrayFunc___getitem__)},
    // type supports number protocol
    {Py_nb_and, reinterpret_cast<void *>(Sbk_QBitArrayFunc___and__)},
    {Py_nb_inplace_xor, reinterpret_cast<void *>(Sbk_QBitArrayFunc___ixor__)},
    {Py_nb_or, reinterpret_cast<void *>(Sbk_QBitArrayFunc___or__)},
    {Py_nb_xor, reinterpret_cast<void *>(Sbk_QBitArrayFunc___xor__)},
    {Py_nb_inplace_or, reinterpret_cast<void *>(Sbk_QBitArrayFunc___ior__)},
    {Py_nb_inplace_and, reinterpret_cast<void *>(Sbk_QBitArrayFunc___iand__)},
    {Py_nb_bool, reinterpret_cast<void *>(Sbk_QBitArray___nb_bool)},
    {Py_nb_invert, reinterpret_cast<void *>(Sbk_QBitArrayFunc___invert__)},
    {0, nullptr}
};
static PyType_Spec Sbk_QBitArray_spec = {
    "2:PySide6.QtCore.QBitArray",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QBitArray_slots
};

} //extern "C"


// Type conversion functions.

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

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

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

// Python to C++ copy conversion.
static void QBitArray_PythonToCpp_QBitArray_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QBitArray *>(cppOut) = *reinterpret_cast< ::QBitArray *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QBitArray_PythonToCpp_QBitArray_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QBitArray_TypeF())))
        return QBitArray_PythonToCpp_QBitArray_COPY;
    return {};
}

// Implicit conversions.
static void qsizetype_PythonToCpp_QBitArray(PyObject *pyIn, void *cppOut)
{
    qsizetype cppIn;
    Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), pyIn, &cppIn);
    *reinterpret_cast<::QBitArray *>(cppOut) = ::QBitArray(cppIn);
}
static PythonToCppFunc is_qsizetype_PythonToCpp_QBitArray_Convertible(PyObject *pyIn)
{
    if (PyLong_Check(pyIn))
        return qsizetype_PythonToCpp_QBitArray;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QBitArray_SignatureStrings[] = {
    "2:PySide6.QtCore.QBitArray(self)",
    "1:PySide6.QtCore.QBitArray(self,other:typing.Union[PySide6.QtCore.QBitArray, qsizetype])",
    "0:PySide6.QtCore.QBitArray(self,size:qsizetype,val:bool=false)",
    "PySide6.QtCore.QBitArray.at(self,i:qsizetype)->bool",
    "PySide6.QtCore.QBitArray.bits(self)->char*",
    "PySide6.QtCore.QBitArray.clear(self)",
    "PySide6.QtCore.QBitArray.clearBit(self,i:qsizetype)",
    "1:PySide6.QtCore.QBitArray.count(self)->qsizetype",
    "0:PySide6.QtCore.QBitArray.count(self,on:bool)->qsizetype",
    "1:PySide6.QtCore.QBitArray.fill(self,val:bool,first:qsizetype,last:qsizetype)",
    "0:PySide6.QtCore.QBitArray.fill(self,val:bool,size:qsizetype=-1)->bool",
    "PySide6.QtCore.QBitArray.fromBits(data:char*,len:qsizetype)->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.isEmpty(self)->bool",
    "PySide6.QtCore.QBitArray.isNull(self)->bool",
    "PySide6.QtCore.QBitArray.resize(self,size:qsizetype)",
    "1:PySide6.QtCore.QBitArray.setBit(self,i:qsizetype)",
    "0:PySide6.QtCore.QBitArray.setBit(self,i:qsizetype,val:bool)",
    "PySide6.QtCore.QBitArray.size(self)->qsizetype",
    "PySide6.QtCore.QBitArray.swap(self,other:typing.Union[PySide6.QtCore.QBitArray, qsizetype])",
    "PySide6.QtCore.QBitArray.testBit(self,i:qsizetype)->bool",
    "PySide6.QtCore.QBitArray.toUInt32(self,endianness:PySide6.QtCore.QSysInfo.Endian,ok:bool*=nullptr)->quint32",
    "PySide6.QtCore.QBitArray.toggleBit(self,i:qsizetype)->bool",
    "PySide6.QtCore.QBitArray.truncate(self,pos:qsizetype)",
    "PySide6.QtCore.QBitArray.__copy__()",
    "PySide6.QtCore.QBitArray.__and__(self,arg__2:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__iand__(self,arg__1:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__xor__(self,arg__2:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__ixor__(self,arg__1:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__or__(self,arg__2:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__ior__(self,arg__1:typing.Union[PySide6.QtCore.QBitArray, qsizetype])->PySide6.QtCore.QBitArray",
    "PySide6.QtCore.QBitArray.__invert__(self)->PySide6.QtCore.QBitArray",
    nullptr}; // Sentinel

void init_QBitArray(PyObject *module)
{
    _Sbk_QBitArray_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QBitArray",
        "QBitArray",
        &Sbk_QBitArray_spec,
        &Shiboken::callCppDestructor< ::QBitArray >,
        0,
        0,
        0);
    auto *pyType = Sbk_QBitArray_TypeF(); // references _Sbk_QBitArray_Type
    InitSignatureStrings(pyType, QBitArray_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QBitArray_Type), Sbk_QBitArray_PropertyStrings);
    SbkPySide6_QtCoreTypes[SBK_QBITARRAY_IDX]
        = Sbk_QBitArray_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QBitArray_TypeF(),
        QBitArray_PythonToCpp_QBitArray_PTR,
        is_QBitArray_PythonToCpp_QBitArray_PTR_Convertible,
        QBitArray_PTR_CppToPython_QBitArray,
        QBitArray_COPY_CppToPython_QBitArray);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QBitArray_PythonToCpp_QBitArray_COPY,
        is_QBitArray_PythonToCpp_QBitArray_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        qsizetype_PythonToCpp_QBitArray,
        is_qsizetype_PythonToCpp_QBitArray_Convertible);

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