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

// main header
#include "qsgrendernode_wrapper.h"

// inner classes
#include "qsgrendernode_renderstate_wrapper.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;
}

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

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

QSGRenderNodeWrapper::QSGRenderNodeWrapper() : QSGRenderNode()
{
    resetPyMethodCache();
    // ... middle
}

QFlags<QSGRenderNode::StateFlag> QSGRenderNodeWrapper::changedStates() const
{
    if (m_PyMethodCache[0])
        return this->::QSGRenderNode::changedStates();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return QFlags<QSGRenderNode::StateFlag>(0);
    static PyObject *nameCache[2] = {};
    static const char *funcName = "changedStates";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[0] = true;
        return this->::QSGRenderNode::changedStates();
    }

    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 QFlags<QSGRenderNode::StateFlag>(0);
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QSGRenderNode.changedStates",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QFlags<QSGRenderNode::StateFlag> >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return QFlags<QSGRenderNode::StateFlag>(0);
    }
    ::QFlags<QSGRenderNode::StateFlag> cppResult = QFlags<QSGRenderNode::StateFlag>(0);
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QFlags<QSGRenderNode::RenderingFlag> QSGRenderNodeWrapper::flags() const
{
    if (m_PyMethodCache[1])
        return this->::QSGRenderNode::flags();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return QFlags<QSGRenderNode::RenderingFlag>(0);
    static PyObject *nameCache[2] = {};
    static const char *funcName = "flags";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[1] = true;
        return this->::QSGRenderNode::flags();
    }

    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 QFlags<QSGRenderNode::RenderingFlag>(0);
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QSGRenderNode.flags",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QFlags<QSGRenderNode::RenderingFlag> >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return QFlags<QSGRenderNode::RenderingFlag>(0);
    }
    ::QFlags<QSGRenderNode::RenderingFlag> cppResult = QFlags<QSGRenderNode::RenderingFlag>(0);
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

bool QSGRenderNodeWrapper::isSubtreeBlocked() const
{
    if (m_PyMethodCache[2])
        return this->::QSGNode::isSubtreeBlocked();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "isSubtreeBlocked";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[2] = true;
        return this->::QSGNode::isSubtreeBlocked();
    }

    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 false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QSGRenderNode.isSubtreeBlocked",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

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

    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;
    }
}

void QSGRenderNodeWrapper::preprocess()
{
    if (m_PyMethodCache[4]) {
        return this->::QSGNode::preprocess();
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "preprocess";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[4] = true;
        return this->::QSGNode::preprocess();
    }

    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;
    }
}

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

    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 {};
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppValueConversion(SbkPySide6_QtCoreTypes[SBK_QRECTF_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QSGRenderNode.rect",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QRectF >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return {};
    }
    ::QRectF cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

void QSGRenderNodeWrapper::releaseResources()
{
    if (m_PyMethodCache[6]) {
        return this->::QSGRenderNode::releaseResources();
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "releaseResources";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[6] = true;
        return this->::QSGRenderNode::releaseResources();
    }

    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;
    }
}

void QSGRenderNodeWrapper::render(const QSGRenderNode::RenderState * state)
{
    if (m_PyMethodCache[7]) {
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QSGRenderNode.render()' not implemented.");
        return;
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "render";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[7] = true;
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QSGRenderNode.render()' not implemented.");
        return;
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERSTATE_IDX], state)
    ));

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

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

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

extern "C" {
static int
Sbk_QSGRenderNode_Init(PyObject *self, PyObject *args, PyObject *kwds)
{
    SbkObject *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PyTypeObject *type = self->ob_type;
    PyTypeObject *myType = SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX];
    if (type == myType) {
        PyErr_SetString(PyExc_NotImplementedError,
            "'QSGRenderNode' represents a C++ abstract class and cannot be instantiated");
        return -1;
    }

    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::QSGRenderNode >()))
        return -1;

    ::QSGRenderNodeWrapper *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.__init__";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // QSGRenderNode()
            cptr = new ::QSGRenderNodeWrapper();
        }
    }

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QSGRenderNode >(), cptr)) {
        delete cptr;
        return -1;
    }
    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;
}

static PyObject *Sbk_QSGRenderNodeFunc_changedStates(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.changedStates";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // changedStates()const
            QFlags<QSGRenderNode::StateFlag> cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? const_cast<const ::QSGRenderNode *>(cppSelf)->::QSGRenderNode::changedStates()
                : const_cast<const ::QSGRenderNode *>(cppSelf)->changedStates();
            pyResult = Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, &cppResult);
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_clipList(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.clipList";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // clipList()const
            const QSGClipNode * cppResult = const_cast<const ::QSGRenderNode *>(cppSelf)->clipList();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtQuickTypes[SBK_QSGCLIPNODE_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_flags(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.flags";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // flags()const
            QFlags<QSGRenderNode::RenderingFlag> cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? const_cast<const ::QSGRenderNode *>(cppSelf)->::QSGRenderNode::flags()
                : const_cast<const ::QSGRenderNode *>(cppSelf)->flags();
            pyResult = Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, &cppResult);
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_inheritedOpacity(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.inheritedOpacity";
    SBK_UNUSED(fullName)

    // Call function/method
    {

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

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

static PyObject *Sbk_QSGRenderNodeFunc_matrix(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.matrix";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // matrix()const
            const QMatrix4x4 * cppResult = const_cast<const ::QSGRenderNode *>(cppSelf)->matrix();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtGuiTypes[SBK_QMATRIX4X4_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_prepare(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.prepare";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // prepare()
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QSGRenderNode::prepare()
                : cppSelf->prepare();
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_rect(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.rect";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // rect()const
            QRectF cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? const_cast<const ::QSGRenderNode *>(cppSelf)->::QSGRenderNode::rect()
                : const_cast<const ::QSGRenderNode *>(cppSelf)->rect();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QRECTF_IDX], &cppResult);
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_releaseResources(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.releaseResources";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // releaseResources()
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QSGRenderNode::releaseResources()
                : cppSelf->releaseResources();
        }
    }

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

static PyObject *Sbk_QSGRenderNodeFunc_render(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtQuick.QSGRenderNode.render";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QSGRenderNode::render(const QSGRenderNode::RenderState*)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERSTATE_IDX], (pyArg)))) {
        overloadId = 0; // render(const QSGRenderNode::RenderState*)
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QSGRenderNode::RenderState *cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // render(const QSGRenderNode::RenderState*)
            if (Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))) {
                PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QSGRenderNode.render()' not implemented.");
                return {};
            }
            cppSelf->render(cppArg0);
        }
    }

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

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


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

static PyMethodDef Sbk_QSGRenderNode_methods[] = {
    {"changedStates", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_changedStates), METH_NOARGS},
    {"clipList", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_clipList), METH_NOARGS},
    {"flags", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_flags), METH_NOARGS},
    {"inheritedOpacity", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_inheritedOpacity), METH_NOARGS},
    {"matrix", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_matrix), METH_NOARGS},
    {"prepare", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_prepare), METH_NOARGS},
    {"rect", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_rect), METH_NOARGS},
    {"releaseResources", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_releaseResources), METH_NOARGS},
    {"render", reinterpret_cast<PyCFunction>(Sbk_QSGRenderNodeFunc_render), METH_O},

    {nullptr, nullptr} // Sentinel
};

static int Sbk_QSGRenderNode_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value && PyCallable_Check(value)) {
        auto plain_inst = reinterpret_cast< ::QSGRenderNode *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX], reinterpret_cast<SbkObject *>(self)));
        auto inst = dynamic_cast<QSGRenderNodeWrapper *>(plain_inst);
        if (inst)
            inst->resetPyMethodCache();
    }
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

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

static PyType_Slot Sbk_QSGRenderNode_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_QSGRenderNode_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QSGRenderNode_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QSGRenderNode_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QSGRenderNode_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QSGRenderNode_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QSGRenderNode_spec = {
    "2:PySide6.QtQuick.QSGRenderNode",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QSGRenderNode_slots
};

} //extern "C"

static void *Sbk_QSGRenderNode_typeDiscovery(void *cptr, PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QSGNode >())
        return dynamic_cast< ::QSGRenderNode *>(reinterpret_cast< ::QSGNode *>(cptr));
    return {};
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_StateFlag___and__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::StateFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::StateFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::StateFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf & cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_StateFlag___or__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::StateFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::StateFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::StateFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf | cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_StateFlag___xor__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::StateFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::StateFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::StateFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf ^ cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_StateFlag___invert__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::StateFlags cppSelf;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, self, &cppSelf);
    ::QSGRenderNode::StateFlags cppResult = ~cppSelf;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))->converter, &cppResult);
}

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

static PyType_Slot SbkPySide6_QtQuick_QSGRenderNode_StateFlag_number_slots[] = {
    {Py_nb_bool,    reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag__nonzero)},
    {Py_nb_invert,  reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag___invert__)},
    {Py_nb_and,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag___and__)},
    {Py_nb_xor,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag___xor__)},
    {Py_nb_or,      reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag___or__)},
    {Py_nb_int,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag_long)},
    {Py_nb_index,   reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_StateFlag_long)},
    {0, nullptr} // sentinel
};


PyObject *SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___and__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::RenderingFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf & cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___or__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::RenderingFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf | cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___xor__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::RenderingFlags cppResult, cppSelf, cppArg;
    cppSelf = static_cast<::QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(self)));
    if (PyErr_Occurred())
        return nullptr;
    cppArg = static_cast<QSGRenderNode::RenderingFlags>(int(PyLong_AsLong(pyArg)));
    if (PyErr_Occurred())
        return nullptr;
    cppResult = cppSelf ^ cppArg;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, &cppResult);
}

PyObject *SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___invert__(PyObject *self, PyObject *pyArg)
{
    ::QSGRenderNode::RenderingFlags cppSelf;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, self, &cppSelf);
    ::QSGRenderNode::RenderingFlags cppResult = ~cppSelf;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))->converter, &cppResult);
}

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

static PyType_Slot SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag_number_slots[] = {
    {Py_nb_bool,    reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag__nonzero)},
    {Py_nb_invert,  reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___invert__)},
    {Py_nb_and,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___and__)},
    {Py_nb_xor,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___xor__)},
    {Py_nb_or,      reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag___or__)},
    {Py_nb_int,     reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag_long)},
    {Py_nb_index,   reinterpret_cast<void *>(SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag_long)},
    {0, nullptr} // sentinel
};



// Type conversion functions.

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

}
static PythonToCppFunc is_QSGRenderNode_StateFlag_PythonToCpp_QSGRenderNode_StateFlag_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX]))
        return QSGRenderNode_StateFlag_PythonToCpp_QSGRenderNode_StateFlag;
    return {};
}
static PyObject *QSGRenderNode_StateFlag_CppToPython_QSGRenderNode_StateFlag(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QSGRenderNode::StateFlag *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX], castCppIn);

}

static void QFlags_QSGRenderNode_StateFlag__PythonToCpp_QFlags_QSGRenderNode_StateFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QSGRenderNode::StateFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::StateFlag>(QFlag(int(PySide::QFlags::getValue(reinterpret_cast<PySideQFlagsObject *>(pyIn)))));

}
static PythonToCppFunc is_QFlags_QSGRenderNode_StateFlag__PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]))
        return QFlags_QSGRenderNode_StateFlag__PythonToCpp_QFlags_QSGRenderNode_StateFlag_;
    return {};
}
static PyObject *QFlags_QSGRenderNode_StateFlag__CppToPython_QFlags_QSGRenderNode_StateFlag_(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QFlags<QSGRenderNode::StateFlag> *>(cppIn));
    return reinterpret_cast<PyObject *>(PySide::QFlags::newObject(castCppIn, SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]));

}

static void QSGRenderNode_StateFlag_PythonToCpp_QFlags_QSGRenderNode_StateFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QSGRenderNode::StateFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::StateFlag>(QFlag(int(Shiboken::Enum::getValue(pyIn))));

}
static PythonToCppFunc is_QSGRenderNode_StateFlag_PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX]))
        return QSGRenderNode_StateFlag_PythonToCpp_QFlags_QSGRenderNode_StateFlag_;
    return {};
}
static void number_PythonToCpp_QFlags_QSGRenderNode_StateFlag_(PyObject *pyIn, void *cppOut)
{
    Shiboken::AutoDecRef pyLong(PyNumber_Long(pyIn));
    *reinterpret_cast<::QFlags<QSGRenderNode::StateFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::StateFlag>(QFlag(int(PyLong_AsLong(pyLong.object()))));

}
static PythonToCppFunc is_number_PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible(PyObject *pyIn)
{
    if (PyNumber_Check(pyIn) && PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX]))
        return number_PythonToCpp_QFlags_QSGRenderNode_StateFlag_;
    return {};
}
static void QSGRenderNode_RenderingFlag_PythonToCpp_QSGRenderNode_RenderingFlag(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QSGRenderNode::RenderingFlag *>(cppOut) =
        static_cast<::QSGRenderNode::RenderingFlag>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QSGRenderNode_RenderingFlag_PythonToCpp_QSGRenderNode_RenderingFlag_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX]))
        return QSGRenderNode_RenderingFlag_PythonToCpp_QSGRenderNode_RenderingFlag;
    return {};
}
static PyObject *QSGRenderNode_RenderingFlag_CppToPython_QSGRenderNode_RenderingFlag(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QSGRenderNode::RenderingFlag *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX], castCppIn);

}

static void QFlags_QSGRenderNode_RenderingFlag__PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QSGRenderNode::RenderingFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::RenderingFlag>(QFlag(int(PySide::QFlags::getValue(reinterpret_cast<PySideQFlagsObject *>(pyIn)))));

}
static PythonToCppFunc is_QFlags_QSGRenderNode_RenderingFlag__PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]))
        return QFlags_QSGRenderNode_RenderingFlag__PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_;
    return {};
}
static PyObject *QFlags_QSGRenderNode_RenderingFlag__CppToPython_QFlags_QSGRenderNode_RenderingFlag_(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QFlags<QSGRenderNode::RenderingFlag> *>(cppIn));
    return reinterpret_cast<PyObject *>(PySide::QFlags::newObject(castCppIn, SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]));

}

static void QSGRenderNode_RenderingFlag_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QSGRenderNode::RenderingFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::RenderingFlag>(QFlag(int(Shiboken::Enum::getValue(pyIn))));

}
static PythonToCppFunc is_QSGRenderNode_RenderingFlag_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX]))
        return QSGRenderNode_RenderingFlag_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_;
    return {};
}
static void number_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_(PyObject *pyIn, void *cppOut)
{
    Shiboken::AutoDecRef pyLong(PyNumber_Long(pyIn));
    *reinterpret_cast<::QFlags<QSGRenderNode::RenderingFlag> *>(cppOut) =
        ::QFlags<QSGRenderNode::RenderingFlag>(QFlag(int(PyLong_AsLong(pyLong.object()))));

}
static PythonToCppFunc is_number_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible(PyObject *pyIn)
{
    if (PyNumber_Check(pyIn) && PyObject_TypeCheck(pyIn, SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX]))
        return number_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_;
    return {};
}
// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QSGRenderNode_PythonToCpp_QSGRenderNode_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QSGRenderNode_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QSGRenderNode_PythonToCpp_QSGRenderNode_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QSGRenderNode_TypeF())))
        return QSGRenderNode_PythonToCpp_QSGRenderNode_PTR;
    return {};
}

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

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QSGRenderNode_SignatureStrings[] = {
    "PySide6.QtQuick.QSGRenderNode(self)",
    "PySide6.QtQuick.QSGRenderNode.changedStates(self)->PySide6.QtQuick.QSGRenderNode.StateFlags",
    "PySide6.QtQuick.QSGRenderNode.clipList(self)->PySide6.QtQuick.QSGClipNode",
    "PySide6.QtQuick.QSGRenderNode.flags(self)->PySide6.QtQuick.QSGRenderNode.RenderingFlags",
    "PySide6.QtQuick.QSGRenderNode.inheritedOpacity(self)->qreal",
    "PySide6.QtQuick.QSGRenderNode.matrix(self)->PySide6.QtGui.QMatrix4x4",
    "PySide6.QtQuick.QSGRenderNode.prepare(self)",
    "PySide6.QtQuick.QSGRenderNode.rect(self)->PySide6.QtCore.QRectF",
    "PySide6.QtQuick.QSGRenderNode.releaseResources(self)",
    "PySide6.QtQuick.QSGRenderNode.render(self,state:PySide6.QtQuick.QSGRenderNode.RenderState)",
    nullptr}; // Sentinel

void init_QSGRenderNode(PyObject *module)
{
    _Sbk_QSGRenderNode_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QSGRenderNode",
        "QSGRenderNode*",
        &Sbk_QSGRenderNode_spec,
        &Shiboken::callCppDestructor< ::QSGRenderNode >,
        SbkPySide6_QtQuickTypes[SBK_QSGNODE_IDX],
        0,
        0);
    auto *pyType = Sbk_QSGRenderNode_TypeF(); // references _Sbk_QSGRenderNode_Type
    InitSignatureStrings(pyType, QSGRenderNode_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QSGRenderNode_Type), Sbk_QSGRenderNode_PropertyStrings);
    SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_IDX]
        = Sbk_QSGRenderNode_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QSGRenderNode_TypeF(),
        QSGRenderNode_PythonToCpp_QSGRenderNode_PTR,
        is_QSGRenderNode_PythonToCpp_QSGRenderNode_PTR_Convertible,
        QSGRenderNode_PTR_CppToPython_QSGRenderNode);

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


    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_QSGRenderNode_TypeF(), &Sbk_QSGRenderNode_typeDiscovery);

    // Initialization of enums.

    // Initialization of enum 'StateFlag'.
    SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX] = PySide::QFlags::create("2:PySide6.QtQuick.QSGRenderNode.StateFlags", SbkPySide6_QtQuick_QSGRenderNode_StateFlag_number_slots);
    SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QSGRenderNode_TypeF(),
        "StateFlag",
        "2:PySide6.QtQuick.QSGRenderNode.StateFlag",
        "QSGRenderNode::StateFlag",
        SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX]);
    if (!SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "DepthState", (long) QSGRenderNode::StateFlag::DepthState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "StencilState", (long) QSGRenderNode::StateFlag::StencilState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "ScissorState", (long) QSGRenderNode::StateFlag::ScissorState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "ColorState", (long) QSGRenderNode::StateFlag::ColorState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "BlendState", (long) QSGRenderNode::StateFlag::BlendState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "CullState", (long) QSGRenderNode::StateFlag::CullState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "ViewportState", (long) QSGRenderNode::StateFlag::ViewportState))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "RenderTargetState", (long) QSGRenderNode::StateFlag::RenderTargetState))
        return;
    // Register converter for enum 'QSGRenderNode::StateFlag'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX],
            QSGRenderNode_StateFlag_CppToPython_QSGRenderNode_StateFlag);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QSGRenderNode_StateFlag_PythonToCpp_QSGRenderNode_StateFlag,
            is_QSGRenderNode_StateFlag_PythonToCpp_QSGRenderNode_StateFlag_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_STATEFLAG_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QSGRenderNode::StateFlag");
        Shiboken::Conversions::registerConverterName(converter, "StateFlag");
    }
    // Register converter for flag 'QFlags<QSGRenderNode::StateFlag>'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX],
            QFlags_QSGRenderNode_StateFlag__CppToPython_QFlags_QSGRenderNode_StateFlag_);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QSGRenderNode_StateFlag_PythonToCpp_QFlags_QSGRenderNode_StateFlag_,
            is_QSGRenderNode_StateFlag_PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QFlags_QSGRenderNode_StateFlag__PythonToCpp_QFlags_QSGRenderNode_StateFlag_,
            is_QFlags_QSGRenderNode_StateFlag__PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            number_PythonToCpp_QFlags_QSGRenderNode_StateFlag_,
            is_number_PythonToCpp_QFlags_QSGRenderNode_StateFlag__Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_STATEFLAG_IDX], converter, true);
        Shiboken::Conversions::registerConverterName(converter, "QSGRenderNode::StateFlags");
        Shiboken::Conversions::registerConverterName(converter, "StateFlags");
        Shiboken::Conversions::registerConverterName(converter, "QFlags<QSGRenderNode::StateFlag>");
    }
    // End of 'StateFlag' enum/flags.

    // Initialization of enum 'RenderingFlag'.
    SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX] = PySide::QFlags::create("2:PySide6.QtQuick.QSGRenderNode.RenderingFlags", SbkPySide6_QtQuick_QSGRenderNode_RenderingFlag_number_slots);
    SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QSGRenderNode_TypeF(),
        "RenderingFlag",
        "2:PySide6.QtQuick.QSGRenderNode.RenderingFlag",
        "QSGRenderNode::RenderingFlag",
        SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX]);
    if (!SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "BoundedRectRendering", (long) QSGRenderNode::RenderingFlag::BoundedRectRendering))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "DepthAwareRendering", (long) QSGRenderNode::RenderingFlag::DepthAwareRendering))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "OpaqueRendering", (long) QSGRenderNode::RenderingFlag::OpaqueRendering))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX],
        Sbk_QSGRenderNode_TypeF(), "NoExternalRendering", (long) QSGRenderNode::RenderingFlag::NoExternalRendering))
        return;
    // Register converter for enum 'QSGRenderNode::RenderingFlag'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX],
            QSGRenderNode_RenderingFlag_CppToPython_QSGRenderNode_RenderingFlag);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QSGRenderNode_RenderingFlag_PythonToCpp_QSGRenderNode_RenderingFlag,
            is_QSGRenderNode_RenderingFlag_PythonToCpp_QSGRenderNode_RenderingFlag_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtQuickTypes[SBK_QSGRENDERNODE_RENDERINGFLAG_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QSGRenderNode::RenderingFlag");
        Shiboken::Conversions::registerConverterName(converter, "RenderingFlag");
    }
    // Register converter for flag 'QFlags<QSGRenderNode::RenderingFlag>'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX],
            QFlags_QSGRenderNode_RenderingFlag__CppToPython_QFlags_QSGRenderNode_RenderingFlag_);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QSGRenderNode_RenderingFlag_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_,
            is_QSGRenderNode_RenderingFlag_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QFlags_QSGRenderNode_RenderingFlag__PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_,
            is_QFlags_QSGRenderNode_RenderingFlag__PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            number_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag_,
            is_number_PythonToCpp_QFlags_QSGRenderNode_RenderingFlag__Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtQuickTypes[SBK_QFLAGS_QSGRENDERNODE_RENDERINGFLAG_IDX], converter, true);
        Shiboken::Conversions::registerConverterName(converter, "QSGRenderNode::RenderingFlags");
        Shiboken::Conversions::registerConverterName(converter, "RenderingFlags");
        Shiboken::Conversions::registerConverterName(converter, "QFlags<QSGRenderNode::RenderingFlag>");
    }
    // End of 'RenderingFlag' enum/flags.

    qRegisterMetaType< ::QSGRenderNode::StateFlag >("QSGRenderNode::StateFlag");
    qRegisterMetaType< ::QSGRenderNode::StateFlags >("QSGRenderNode::StateFlags");
    qRegisterMetaType< ::QSGRenderNode::RenderingFlag >("QSGRenderNode::RenderingFlag");
    qRegisterMetaType< ::QSGRenderNode::RenderingFlags >("QSGRenderNode::RenderingFlags");
}
