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

//workaround to access protected functions
#define protected public

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

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtgui_python.h"

// main header
#include "qbitmap_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;
}

// Native ---------------------------------------------------------

void QBitmapWrapper::resetPyMethodCache()
{
    std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false);
}

QBitmapWrapper::QBitmapWrapper() : QBitmap()
{
    resetPyMethodCache();
    // ... middle
}

QBitmapWrapper::QBitmapWrapper(const QPixmap & arg__1) : QBitmap(arg__1)
{
    resetPyMethodCache();
    // ... middle
}

QBitmapWrapper::QBitmapWrapper(const QSize & arg__1) : QBitmap(arg__1)
{
    resetPyMethodCache();
    // ... middle
}

QBitmapWrapper::QBitmapWrapper(const QString & fileName, const char * format) : QBitmap(fileName, format)
{
    resetPyMethodCache();
    // ... middle
}

QBitmapWrapper::QBitmapWrapper(int w, int h) : QBitmap(w, h)
{
    resetPyMethodCache();
    // ... middle
}

int QBitmapWrapper::devType() const
{
    if (m_PyMethodCache[0])
        return this->::QPixmap::devType();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return 0;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "devType";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[0] = true;
        return this->::QPixmap::devType();
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return 0;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QBitmap.devType",
            "int",
            Py_TYPE(pyResult)->tp_name);
        return 0;
    }
    int cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

void QBitmapWrapper::initPainter(QPainter * painter) const
{
    if (m_PyMethodCache[1]) {
        return this->::QPaintDevice::initPainter(painter);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "initPainter";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[1] = true;
        return this->::QPaintDevice::initPainter(painter);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], painter)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return;
    }
}

int QBitmapWrapper::metric(QPaintDevice::PaintDeviceMetric arg__1) const
{
    if (m_PyMethodCache[2])
        return this->::QPixmap::metric(arg__1);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return 0;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "metric";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[2] = true;
        return this->::QPixmap::metric(arg__1);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_PAINTDEVICEMETRIC_IDX]))->converter, &arg__1)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return 0;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QBitmap.metric",
            "int",
            Py_TYPE(pyResult)->tp_name);
        return 0;
    }
    int cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPaintEngine * QBitmapWrapper::paintEngine() const
{
    if (m_PyMethodCache[3])
        return this->::QPixmap::paintEngine();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "paintEngine";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[3] = true;
        return this->::QPixmap::paintEngine();
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTENGINE_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QBitmap.paintEngine",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPaintEngine >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPaintEngine *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPaintDevice * QBitmapWrapper::redirected(QPoint * offset) const
{
    if (m_PyMethodCache[4])
        return this->::QPaintDevice::redirected(offset);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "redirected";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[4] = true;
        return this->::QPaintDevice::redirected(offset);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], offset)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QBitmap.redirected",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPaintDevice >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPaintDevice *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPainter * QBitmapWrapper::sharedPainter() const
{
    if (m_PyMethodCache[5])
        return this->::QPaintDevice::sharedPainter();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "sharedPainter";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[5] = true;
        return this->::QPaintDevice::sharedPainter();
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QBitmap.sharedPainter",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPainter >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPainter *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QBitmapWrapper::~QBitmapWrapper()
{
    SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this);
    Shiboken::Object::destroy(wrapper, this);
}

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

extern "C" {
static int
Sbk_QBitmap_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< ::QBitmap >()))
        return -1;

    ::QBitmapWrapper *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QBitmap.__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_QBitmap_Init_TypeError;
    }

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


    // Overloaded function decisor
    // 0: QBitmap::QBitmap()
    // 1: QBitmap::QBitmap(QBitmap)
    // 2: QBitmap::QBitmap(QPixmap)
    // 3: QBitmap::QBitmap(QSize)
    // 4: QBitmap::QBitmap(QString,const char*)
    // 5: QBitmap::QBitmap(int,int)
    if (numArgs == 0) {
        overloadId = 0; // QBitmap()
    } else if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))) {
        overloadId = 5; // QBitmap(int,int)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 4; // QBitmap(QString,const char*)
        } else if (numArgs >= 2
            && Shiboken::String::check(pyArgs[1]) && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<const char *>(), (pyArgs[1])))) {
            overloadId = 4; // QBitmap(QString,const char*)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QSIZE_IDX], (pyArgs[0])))) {
        overloadId = 3; // QBitmap(QSize)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], (pyArgs[0])))) {
        overloadId = 1; // QBitmap(QBitmap)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPIXMAP_IDX], (pyArgs[0])))) {
        overloadId = 2; // QBitmap(QPixmap)
    }

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

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

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


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


            if (!PyErr_Occurred()) {
                // QBitmap(QPixmap)
                cptr = new ::QBitmapWrapper(*cppArg0);
            }
            PyErr_WarnEx(PyExc_DeprecationWarning, "QBitmap.QBitmap(const QPixmap & arg__1) is deprecated", 1);
            break;
        }
        case 3: // QBitmap(const QSize & arg__1)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QBitmap_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QSize cppArg0_local;
            ::QSize *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QBitmap(QSize)
                cptr = new ::QBitmapWrapper(*cppArg0);
            }
            break;
        }
        case 4: // QBitmap(const QString & fileName, const char * format)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_format = Shiboken::String::createStaticString("format");
                if (PyDict_Contains(kwds, key_format)) {
                    value = PyDict_GetItem(kwds, key_format);
                    if (value && pyArgs[1]) {
                        errInfo.reset(key_format);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QBitmap_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[1] = value;
                        if (!Shiboken::String::check(pyArgs[1]) && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<const char *>(), (pyArgs[1]))))
                            goto Sbk_QBitmap_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_format);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QBitmap_Init_TypeError;
                }
            }
            ::QString cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            const char* cppArg1 = nullptr;
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QBitmap(QString,const char*)
                cptr = new ::QBitmapWrapper(cppArg0, cppArg1);
            }
            break;
        }
        case 5: // QBitmap(int w, int h)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QBitmap_Init_TypeError;
            }
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            int cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QBitmap(int,int)
                cptr = new ::QBitmapWrapper(cppArg0, cppArg1);
            }
            break;
        }
    }

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

    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::Object::setHasCppWrapper(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_QBitmap_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

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

    // Call function/method
    {

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

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

static PyObject *Sbk_QBitmapFunc_fromData(PyObject *self, PyObject *args, PyObject *kwds)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QBitmap.fromData";
    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_QBitmapFunc_fromData_TypeError;
    } else if (numArgs < 2) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QBitmapFunc_fromData_TypeError;
    }

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


    // Overloaded function decisor
    // 0: static QBitmap::fromData(QSize,PyBuffer,QImage::Format)->QBitmap
    if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QSIZE_IDX], (pyArgs[0])))
        && Shiboken::Buffer::checkType(pyArgs[1])) {
        if (numArgs == 2) {
            overloadId = 0; // fromData(QSize,const uchar*,QImage::Format)
        } else if (numArgs >= 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QIMAGE_FORMAT_IDX]))->converter, (pyArgs[2])))) {
            overloadId = 0; // fromData(QSize,const uchar*,QImage::Format)
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_monoFormat = Shiboken::String::createStaticString("monoFormat");
            if (PyDict_Contains(kwds, key_monoFormat)) {
                value = PyDict_GetItem(kwds, key_monoFormat);
                if (value && pyArgs[2]) {
                    errInfo.reset(key_monoFormat);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QBitmapFunc_fromData_TypeError;
                }
                if (value) {
                    pyArgs[2] = value;
                    if (!(pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QIMAGE_FORMAT_IDX]))->converter, (pyArgs[2]))))
                        goto Sbk_QBitmapFunc_fromData_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_monoFormat);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QBitmapFunc_fromData_TypeError;
            }
        }
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QSize cppArg0_local;
        ::QSize *cppArg0 = &cppArg0_local;
        if (pythonToCpp[0].isValue())
            pythonToCpp[0](pyArgs[0], &cppArg0_local);
        else
            pythonToCpp[0](pyArgs[0], &cppArg0);

        ::QImage::Format cppArg2(QImage::Format_MonoLSB);
        if (pythonToCpp[2])
            pythonToCpp[2](pyArgs[2], &cppArg2);

        if (!PyErr_Occurred()) {
            // fromData(QSize,const uchar*,QImage::Format)
            // Begin code injection
            // ========================================================================
            // START of custom code block [file: ../glue/qtgui.cpp (qbitmap-fromdata)]
            auto *buffer = reinterpret_cast<uchar *>(Shiboken::Buffer::getPointer(pyArgs[2-1]));
            QBitmap cppResult = QBitmap::fromData((*cppArg0), buffer, cppArg2);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], &cppResult);
            // END of custom code block [file: ../glue/qtgui.cpp (qbitmap-fromdata)]
            // ========================================================================
            // End of code injection

        }
    }

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

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

static PyObject *Sbk_QBitmapFunc_fromImage(PyObject *self, PyObject *args, PyObject *kwds)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QBitmap.fromImage";
    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_QBitmapFunc_fromImage_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QBitmapFunc_fromImage_TypeError;
    }

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


    // Overloaded function decisor
    // 0: static QPixmap::fromImage(QImage,QFlags<Qt::ImageConversionFlag>)->QBitmap
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QIMAGE_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // fromImage(QImage,QFlags<Qt::ImageConversionFlag>)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_IMAGECONVERSIONFLAG_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 0; // fromImage(QImage,QFlags<Qt::ImageConversionFlag>)
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_flags = Shiboken::String::createStaticString("flags");
            if (PyDict_Contains(kwds, key_flags)) {
                value = PyDict_GetItem(kwds, key_flags);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_flags);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QBitmapFunc_fromImage_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_IMAGECONVERSIONFLAG_IDX]))->converter, (pyArgs[1]))))
                        goto Sbk_QBitmapFunc_fromImage_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_flags);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QBitmapFunc_fromImage_TypeError;
            }
        }
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QImage cppArg0_local;
        ::QImage *cppArg0 = &cppArg0_local;
        if (pythonToCpp[0].isValue())
            pythonToCpp[0](pyArgs[0], &cppArg0_local);
        else
            pythonToCpp[0](pyArgs[0], &cppArg0);

        ::QFlags<Qt::ImageConversionFlag> cppArg1(Qt::AutoColor);
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // fromImage(QImage,QFlags<Qt::ImageConversionFlag>)
            QBitmap cppResult = ::QBitmap::fromImage(*cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], &cppResult);
        }
    }

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

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

static PyObject *Sbk_QBitmapFunc_fromPixmap(PyObject *self, PyObject *pyArg)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QBitmap.fromPixmap";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: static QBitmap::fromPixmap(QPixmap)->QBitmap
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPIXMAP_IDX], (pyArg)))) {
        overloadId = 0; // fromPixmap(QPixmap)
    }

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

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


        if (!PyErr_Occurred()) {
            // fromPixmap(QPixmap)
            QBitmap cppResult = ::QBitmap::fromPixmap(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], &cppResult);
        }
    }

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

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

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

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

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

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


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

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

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

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

    // Overloaded function decisor
    // 0: QBitmap::transformed(QTransform)const->QBitmap
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QTRANSFORM_IDX], (pyArg)))) {
        overloadId = 0; // transformed(QTransform)const
    }

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

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


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

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

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

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


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

static PyMethodDef Sbk_QBitmap_methods[] = {
    {"clear", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_clear), METH_NOARGS},
    {"fromData", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_fromData), METH_VARARGS|METH_KEYWORDS|METH_STATIC},
    {"fromImage", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_fromImage), METH_VARARGS|METH_KEYWORDS|METH_STATIC},
    {"fromPixmap", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_fromPixmap), METH_O|METH_STATIC},
    {"swap", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_swap), METH_O},
    {"transformed", reinterpret_cast<PyCFunction>(Sbk_QBitmapFunc_transformed), METH_O},

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

static int Sbk_QBitmap_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value && PyCallable_Check(value)) {
        auto plain_inst = reinterpret_cast< ::QBitmap *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], reinterpret_cast<SbkObject *>(self)));
        auto inst = dynamic_cast<QBitmapWrapper *>(plain_inst);
        if (inst)
            inst->resetPyMethodCache();
    }
    return PyObject_GenericSetAttr(self, name, value);
}

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

} // extern "C"

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

static PyType_Slot Sbk_QBitmap_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,    reinterpret_cast<void *>(Sbk_QBitmap_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QBitmap_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QBitmap_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QBitmap_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QBitmap_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    // type supports number protocol
    {Py_nb_bool, reinterpret_cast<void *>(Sbk_QBitmap___nb_bool)},
    {0, nullptr}
};
static PyType_Spec Sbk_QBitmap_spec = {
    "2:PySide6.QtGui.QBitmap",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QBitmap_slots
};

} //extern "C"

static void *Sbk_QBitmap_typeDiscovery(void *cptr, PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QPaintDevice >())
        return dynamic_cast< ::QBitmap *>(reinterpret_cast< ::QPaintDevice *>(cptr));
    return {};
}


// Type conversion functions.

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

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

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

// Python to C++ copy conversion.
static void QBitmap_PythonToCpp_QBitmap_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QBitmap *>(cppOut) = *reinterpret_cast< ::QBitmap *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QBitmap_PythonToCpp_QBitmap_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QBitmap_TypeF())))
        return QBitmap_PythonToCpp_QBitmap_COPY;
    return {};
}

// Implicit conversions.
static void PySide6_QtCore_constQStringREF_PythonToCpp_QBitmap(PyObject *pyIn, void *cppOut)
{
    ::QString cppIn;
    Shiboken::Conversions::pythonToCppCopy(SbkPySide6_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn, &cppIn);
    *reinterpret_cast<::QBitmap *>(cppOut) = ::QBitmap(cppIn);
}
static PythonToCppFunc is_PySide6_QtCore_constQStringREF_PythonToCpp_QBitmap_Convertible(PyObject *pyIn)
{
    if (PyUnicode_Check(pyIn))
        return PySide6_QtCore_constQStringREF_PythonToCpp_QBitmap;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QBitmap_SignatureStrings[] = {
    "5:PySide6.QtGui.QBitmap(self)",
    "4:PySide6.QtGui.QBitmap(self,QBitmap:typing.Union[PySide6.QtGui.QBitmap, QString])",
    "3:PySide6.QtGui.QBitmap(self,arg__1:typing.Union[PySide6.QtGui.QPixmap, PySide6.QtGui.QImage, QString])",
    "2:PySide6.QtGui.QBitmap(self,arg__1:PySide6.QtCore.QSize)",
    "1:PySide6.QtGui.QBitmap(self,fileName:QString,format:char*=nullptr)",
    "0:PySide6.QtGui.QBitmap(self,w:int,h:int)",
    "PySide6.QtGui.QBitmap.clear(self)",
    "PySide6.QtGui.QBitmap.fromData(size:PySide6.QtCore.QSize,bits:PyBuffer,monoFormat:PySide6.QtGui.QImage.Format=QImage.Format_MonoLSB)->PySide6.QtGui.QBitmap",
    "PySide6.QtGui.QBitmap.fromImage(image:typing.Union[PySide6.QtGui.QImage, QString],flags:PySide6.QtCore.Qt.ImageConversionFlags=Qt.AutoColor)->PySide6.QtGui.QBitmap",
    "PySide6.QtGui.QBitmap.fromPixmap(pixmap:typing.Union[PySide6.QtGui.QPixmap, PySide6.QtGui.QImage, QString])->PySide6.QtGui.QBitmap",
    "PySide6.QtGui.QBitmap.swap(self,other:typing.Union[PySide6.QtGui.QBitmap, QString])",
    "PySide6.QtGui.QBitmap.transformed(self,matrix:PySide6.QtGui.QTransform)->PySide6.QtGui.QBitmap",
    "PySide6.QtGui.QBitmap.__copy__()",
    nullptr}; // Sentinel

void init_QBitmap(PyObject *module)
{
    _Sbk_QBitmap_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QBitmap",
        "QBitmap",
        &Sbk_QBitmap_spec,
        &Shiboken::callCppDestructor< ::QBitmapWrapper >,
        SbkPySide6_QtGuiTypes[SBK_QPIXMAP_IDX],
        0,
        0);
    auto *pyType = Sbk_QBitmap_TypeF(); // references _Sbk_QBitmap_Type
    InitSignatureStrings(pyType, QBitmap_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QBitmap_Type), Sbk_QBitmap_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QBITMAP_IDX]
        = Sbk_QBitmap_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QBitmap_TypeF(),
        QBitmap_PythonToCpp_QBitmap_PTR,
        is_QBitmap_PythonToCpp_QBitmap_PTR_Convertible,
        QBitmap_PTR_CppToPython_QBitmap,
        QBitmap_COPY_CppToPython_QBitmap);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QBitmap_PythonToCpp_QBitmap_COPY,
        is_QBitmap_PythonToCpp_QBitmap_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        PySide6_QtCore_constQStringREF_PythonToCpp_QBitmap,
        is_PySide6_QtCore_constQStringREF_PythonToCpp_QBitmap_Convertible);

    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_QBitmap_TypeF(), &Sbk_QBitmap_typeDiscovery);

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