/****************************************************************************
**
** 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 <signalmanager.h>
#include <pysidemetafunction.h>
#include <iterator>

// module include
#include "pyside6_qtcore_python.h"

// main header
#include "qitemselectionmodel_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 QItemSelectionModelWrapper::resetPyMethodCache()
{
    std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false);
}

QItemSelectionModelWrapper::QItemSelectionModelWrapper(QAbstractItemModel * model) : QItemSelectionModel(model)
{
    resetPyMethodCache();
    // ... middle
}

QItemSelectionModelWrapper::QItemSelectionModelWrapper(QAbstractItemModel * model, QObject * parent) : QItemSelectionModel(model, parent)
{
    resetPyMethodCache();
    // ... middle
}

void QItemSelectionModelWrapper::childEvent(QChildEvent * event)
{
    if (m_PyMethodCache[0]) {
        return this->::QObject::childEvent(event);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "childEvent";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[0] = true;
        return this->::QObject::childEvent(event);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QCHILDEVENT_IDX], event)
    ));
    bool invalidateArg1 = PyTuple_GET_ITEM(pyArgs, 0)->ob_refcnt == 1;

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

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

    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 QItemSelectionModelWrapper::clearCurrentIndex()
{
    if (m_PyMethodCache[2]) {
        return this->::QItemSelectionModel::clearCurrentIndex();
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "clearCurrentIndex";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[2] = true;
        return this->::QItemSelectionModel::clearCurrentIndex();
    }

    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 QItemSelectionModelWrapper::connectNotify(const QMetaMethod & signal)
{
    if (m_PyMethodCache[3]) {
        return this->::QObject::connectNotify(signal);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "connectNotify";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[3] = true;
        return this->::QObject::connectNotify(signal);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMETAMETHOD_IDX], &signal)
    ));

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

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

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QEVENT_IDX], event)
    ));
    bool invalidateArg1 = PyTuple_GET_ITEM(pyArgs, 0)->ob_refcnt == 1;

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

void QItemSelectionModelWrapper::disconnectNotify(const QMetaMethod & signal)
{
    if (m_PyMethodCache[5]) {
        return this->::QObject::disconnectNotify(signal);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "disconnectNotify";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[5] = true;
        return this->::QObject::disconnectNotify(signal);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMETAMETHOD_IDX], &signal)
    ));

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

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

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QEVENT_IDX], event)
    ));
    bool invalidateArg1 = PyTuple_GET_ITEM(pyArgs, 0)->ob_refcnt == 1;

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (invalidateArg1)
        Shiboken::Object::invalidate(PyTuple_GET_ITEM(pyArgs, 0));
    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.",
            "QItemSelectionModel.event",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

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

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX], watched),
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QEVENT_IDX], event)
    ));
    bool invalidateArg2 = PyTuple_GET_ITEM(pyArgs, 1)->ob_refcnt == 1;

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (invalidateArg2)
        Shiboken::Object::invalidate(PyTuple_GET_ITEM(pyArgs, 1));
    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.",
            "QItemSelectionModel.eventFilter",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

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

    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 QItemSelectionModelWrapper::select(const QItemSelection & selection, QFlags<QItemSelectionModel::SelectionFlag> command)
{
    if (m_PyMethodCache[10]) {
        return this->::QItemSelectionModel::select(selection, command);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "select";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[10] = true;
        return this->::QItemSelectionModel::select(selection, command);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTION_IDX], &selection),
        Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, &command)
    ));

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

void QItemSelectionModelWrapper::select(const QModelIndex & index, QFlags<QItemSelectionModel::SelectionFlag> command)
{
    if (m_PyMethodCache[11]) {
        return this->::QItemSelectionModel::select(index, command);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "select";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[11] = true;
        return this->::QItemSelectionModel::select(index, command);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], &index),
        Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, &command)
    ));

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

void QItemSelectionModelWrapper::setCurrentIndex(const QModelIndex & index, QFlags<QItemSelectionModel::SelectionFlag> command)
{
    if (m_PyMethodCache[12]) {
        return this->::QItemSelectionModel::setCurrentIndex(index, command);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setCurrentIndex";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[12] = true;
        return this->::QItemSelectionModel::setCurrentIndex(index, command);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], &index),
        Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, &command)
    ));

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

void QItemSelectionModelWrapper::timerEvent(QTimerEvent * event)
{
    if (m_PyMethodCache[13]) {
        return this->::QObject::timerEvent(event);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "timerEvent";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[13] = true;
        return this->::QObject::timerEvent(event);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QTIMEREVENT_IDX], event)
    ));
    bool invalidateArg1 = PyTuple_GET_ITEM(pyArgs, 0)->ob_refcnt == 1;

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

const QMetaObject *QItemSelectionModelWrapper::metaObject() const
{
    if (QObject::d_ptr->metaObject)
        return QObject::d_ptr->dynamicMetaObject();
    SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);
    if (pySelf == nullptr)
        return QItemSelectionModel::metaObject();
    return PySide::SignalManager::retrieveMetaObject(reinterpret_cast<PyObject *>(pySelf));
}

int QItemSelectionModelWrapper::qt_metacall(QMetaObject::Call call, int id, void **args)
{
    int result = QItemSelectionModel::qt_metacall(call, id, args);
    return result < 0 ? result : PySide::SignalManager::qt_metacall(this, call, id, args);
}

void *QItemSelectionModelWrapper::qt_metacast(const char *_clname)
{
    if (!_clname)
        return {};
    SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);
    if (pySelf && PySide::inherits(Py_TYPE(pySelf), _clname))
        return static_cast<void *>(const_cast< QItemSelectionModelWrapper *>(this));
    return QItemSelectionModel::qt_metacast(_clname);
}

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

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

extern "C" {
static int
Sbk_QItemSelectionModel_Init(PyObject *self, PyObject *args, PyObject *kwds)
{
    const QMetaObject *metaObject;
    SbkObject *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::QItemSelectionModel >()))
        return -1;

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

    // invalid argument lengths


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


    // Overloaded function decisor
    // 0: QItemSelectionModel::QItemSelectionModel(QAbstractItemModel*)
    // 1: QItemSelectionModel::QItemSelectionModel(QAbstractItemModel*,QObject*)
    if (numArgs == 0) {
        overloadId = 0; // QItemSelectionModel(QAbstractItemModel*)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtCoreTypes[SBK_QABSTRACTITEMMODEL_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // QItemSelectionModel(QAbstractItemModel*)
        } else if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX], (pyArgs[1])))) {
            overloadId = 1; // QItemSelectionModel(QAbstractItemModel*,QObject*)
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // QItemSelectionModel(QAbstractItemModel * model)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_model = Shiboken::String::createStaticString("model");
                if (PyDict_Contains(kwds, key_model)) {
                    value = PyDict_GetItem(kwds, key_model);
                    if (value && pyArgs[0]) {
                        errInfo.reset(key_model);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QItemSelectionModel_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[0] = value;
                        if (!(pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtCoreTypes[SBK_QABSTRACTITEMMODEL_IDX], (pyArgs[0]))))
                            goto Sbk_QItemSelectionModel_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_model);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    // fall through to handle extra keyword signals and properties
                }
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QAbstractItemModel *cppArg0 = nullptr;
            if (pythonToCpp[0])
                pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!PyErr_Occurred()) {
                // QItemSelectionModel(QAbstractItemModel*)
                void *addr = PySide::nextQObjectMemoryAddr();
                if (addr) {
                    cptr = new (addr) ::QItemSelectionModelWrapper(cppArg0);
                    PySide::setNextQObjectMemoryAddr(0);
                } else {
                    cptr = new ::QItemSelectionModelWrapper(cppArg0);
                }

            }
            break;
        }
        case 1: // QItemSelectionModel(QAbstractItemModel * model, QObject * parent)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QItemSelectionModel_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QAbstractItemModel *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QObject *cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // QItemSelectionModel(QAbstractItemModel*,QObject*)
                void *addr = PySide::nextQObjectMemoryAddr();
                if (addr) {
                    cptr = new (addr) ::QItemSelectionModelWrapper(cppArg0, cppArg1);
                    PySide::setNextQObjectMemoryAddr(0);
                } else {
                    cptr = new ::QItemSelectionModelWrapper(cppArg0, cppArg1);
                }

                Shiboken::Object::setParent(pyArgs[1], self);
            }
            break;
        }
    }

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

    // QObject setup
    PySide::Signal::updateSourceObject(self);
    metaObject = cptr->metaObject(); // <- init python qt properties
    if (!errInfo.isNull() && PyDict_Check(errInfo.object())) {
        if (!PySide::fillQtProperties(self, metaObject, errInfo))
            goto Sbk_QItemSelectionModel_Init_TypeError;
    };


    return 1;

    Sbk_QItemSelectionModel_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

    // Call function/method
    {

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

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

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

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


    // Overloaded function decisor
    // 0: QItemSelectionModel::columnIntersectsSelection(int,QModelIndex)const->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // columnIntersectsSelection(int,QModelIndex)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1])))) {
            overloadId = 0; // columnIntersectsSelection(int,QModelIndex)const
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_parent = Shiboken::String::createStaticString("parent");
            if (PyDict_Contains(kwds, key_parent)) {
                value = PyDict_GetItem(kwds, key_parent);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_parent);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_columnIntersectsSelection_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1]))))
                        goto Sbk_QItemSelectionModelFunc_columnIntersectsSelection_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_parent);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_columnIntersectsSelection_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QModelIndex cppArg1_local = QModelIndex();
        ::QModelIndex *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1]) {
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);
            }

        if (!PyErr_Occurred()) {
            // columnIntersectsSelection(int,QModelIndex)const
            bool cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->columnIntersectsSelection(cppArg0, *cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // currentIndex()const
            QModelIndex cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->currentIndex();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], &cppResult);
        }
    }

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

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

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "emitSelectionChanged", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QItemSelectionModel::emitSelectionChanged(QItemSelection,QItemSelection)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTION_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTION_IDX], (pyArgs[1])))) {
        overloadId = 0; // emitSelectionChanged(QItemSelection,QItemSelection)
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QItemSelection cppArg0_local;
        ::QItemSelection *cppArg0 = &cppArg0_local;
        if (pythonToCpp[0].isValue())
            pythonToCpp[0](pyArgs[0], &cppArg0_local);
        else
            pythonToCpp[0](pyArgs[0], &cppArg0);

        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QItemSelection cppArg1_local;
        ::QItemSelection *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1].isValue())
            pythonToCpp[1](pyArgs[1], &cppArg1_local);
        else
            pythonToCpp[1](pyArgs[1], &cppArg1);


        if (!PyErr_Occurred()) {
            // emitSelectionChanged(QItemSelection,QItemSelection)
            cppSelf->emitSelectionChanged(*cppArg0, *cppArg1);
        }
    }

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

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

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

    // Call function/method
    {

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

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

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

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


    // Overloaded function decisor
    // 0: QItemSelectionModel::isColumnSelected(int,QModelIndex)const->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // isColumnSelected(int,QModelIndex)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1])))) {
            overloadId = 0; // isColumnSelected(int,QModelIndex)const
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_parent = Shiboken::String::createStaticString("parent");
            if (PyDict_Contains(kwds, key_parent)) {
                value = PyDict_GetItem(kwds, key_parent);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_parent);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_isColumnSelected_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1]))))
                        goto Sbk_QItemSelectionModelFunc_isColumnSelected_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_parent);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_isColumnSelected_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QModelIndex cppArg1_local = QModelIndex();
        ::QModelIndex *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1]) {
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);
            }

        if (!PyErr_Occurred()) {
            // isColumnSelected(int,QModelIndex)const
            bool cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->isColumnSelected(cppArg0, *cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

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

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

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

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


    // Overloaded function decisor
    // 0: QItemSelectionModel::isRowSelected(int,QModelIndex)const->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // isRowSelected(int,QModelIndex)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1])))) {
            overloadId = 0; // isRowSelected(int,QModelIndex)const
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_parent = Shiboken::String::createStaticString("parent");
            if (PyDict_Contains(kwds, key_parent)) {
                value = PyDict_GetItem(kwds, key_parent);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_parent);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_isRowSelected_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1]))))
                        goto Sbk_QItemSelectionModelFunc_isRowSelected_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_parent);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_isRowSelected_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QModelIndex cppArg1_local = QModelIndex();
        ::QModelIndex *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1]) {
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);
            }

        if (!PyErr_Occurred()) {
            // isRowSelected(int,QModelIndex)const
            bool cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->isRowSelected(cppArg0, *cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QItemSelectionModel::isSelected(QModelIndex)const->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArg)))) {
        overloadId = 0; // isSelected(QModelIndex)const
    }

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

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


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

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // model()
            QAbstractItemModel * cppResult = cppSelf->model();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QABSTRACTITEMMODEL_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

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

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

    // Call function/method
    {

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

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

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

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


    // Overloaded function decisor
    // 0: QItemSelectionModel::rowIntersectsSelection(int,QModelIndex)const->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // rowIntersectsSelection(int,QModelIndex)const
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1])))) {
            overloadId = 0; // rowIntersectsSelection(int,QModelIndex)const
        }
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_parent = Shiboken::String::createStaticString("parent");
            if (PyDict_Contains(kwds, key_parent)) {
                value = PyDict_GetItem(kwds, key_parent);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_parent);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_rowIntersectsSelection_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[1]))))
                        goto Sbk_QItemSelectionModelFunc_rowIntersectsSelection_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_parent);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_rowIntersectsSelection_TypeError;
            }
        }
        int cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QModelIndex cppArg1_local = QModelIndex();
        ::QModelIndex *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1]) {
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);
            }

        if (!PyErr_Occurred()) {
            // rowIntersectsSelection(int,QModelIndex)const
            bool cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->rowIntersectsSelection(cppArg0, *cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

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

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

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

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "select", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QItemSelectionModel::select(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
    // 1: QItemSelectionModel::select(QItemSelection,QFlags<QItemSelectionModel::SelectionFlag>)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTION_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, (pyArgs[1])))) {
        overloadId = 1; // select(QItemSelection,QFlags<QItemSelectionModel::SelectionFlag>)
    } else if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, (pyArgs[1])))) {
        overloadId = 0; // select(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // select(const QModelIndex & index, QFlags<QItemSelectionModel::SelectionFlag> command)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QModelIndex cppArg0_local;
            ::QModelIndex *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            ::QFlags<QItemSelectionModel::SelectionFlag> cppArg1 = QFlags<QItemSelectionModel::SelectionFlag>(0);
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // select(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
                Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                    ? cppSelf->::QItemSelectionModel::select(*cppArg0, cppArg1)
                    : cppSelf->select(*cppArg0, cppArg1);
            }
            break;
        }
        case 1: // select(const QItemSelection & selection, QFlags<QItemSelectionModel::SelectionFlag> command)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::QItemSelection cppArg0_local;
            ::QItemSelection *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            ::QFlags<QItemSelectionModel::SelectionFlag> cppArg1 = QFlags<QItemSelectionModel::SelectionFlag>(0);
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!PyErr_Occurred()) {
                // select(QItemSelection,QFlags<QItemSelectionModel::SelectionFlag>)
                Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                    ? cppSelf->::QItemSelectionModel::select(*cppArg0, cppArg1)
                    : cppSelf->select(*cppArg0, cppArg1);
            }
            break;
        }
    }

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

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

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

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

    if (!PyArg_ParseTuple(args, "|O:selectedColumns", &(pyArgs[0])))
        return {};


    // Overloaded function decisor
    // 0: QItemSelectionModel::selectedColumns(int)const->QModelIndexList
    if (numArgs == 0) {
        overloadId = 0; // selectedColumns(int)const
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        overloadId = 0; // selectedColumns(int)const
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_row = Shiboken::String::createStaticString("row");
            if (PyDict_Contains(kwds, key_row)) {
                value = PyDict_GetItem(kwds, key_row);
                if (value && pyArgs[0]) {
                    errInfo.reset(key_row);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_selectedColumns_TypeError;
                }
                if (value) {
                    pyArgs[0] = value;
                    if (!(pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0]))))
                        goto Sbk_QItemSelectionModelFunc_selectedColumns_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_row);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_selectedColumns_TypeError;
            }
        }
        int cppArg0 = 0;
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);

        if (!PyErr_Occurred()) {
            // selectedColumns(int)const
            QModelIndexList cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->selectedColumns(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QMODELINDEXLIST_IDX], &cppResult);
        }
    }

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // selectedIndexes()const
            QModelIndexList cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->selectedIndexes();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QMODELINDEXLIST_IDX], &cppResult);
        }
    }

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

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

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

    if (!PyArg_ParseTuple(args, "|O:selectedRows", &(pyArgs[0])))
        return {};


    // Overloaded function decisor
    // 0: QItemSelectionModel::selectedRows(int)const->QModelIndexList
    if (numArgs == 0) {
        overloadId = 0; // selectedRows(int)const
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        overloadId = 0; // selectedRows(int)const
    }

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

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_column = Shiboken::String::createStaticString("column");
            if (PyDict_Contains(kwds, key_column)) {
                value = PyDict_GetItem(kwds, key_column);
                if (value && pyArgs[0]) {
                    errInfo.reset(key_column);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QItemSelectionModelFunc_selectedRows_TypeError;
                }
                if (value) {
                    pyArgs[0] = value;
                    if (!(pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0]))))
                        goto Sbk_QItemSelectionModelFunc_selectedRows_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_column);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QItemSelectionModelFunc_selectedRows_TypeError;
            }
        }
        int cppArg0 = 0;
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);

        if (!PyErr_Occurred()) {
            // selectedRows(int)const
            QModelIndexList cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->selectedRows(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QMODELINDEXLIST_IDX], &cppResult);
        }
    }

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

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // selection()const
            const QItemSelection cppResult = const_cast<const ::QItemSelectionModel *>(cppSelf)->selection();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTION_IDX], &cppResult);
        }
    }

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

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

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "setCurrentIndex", 2, 2, &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QItemSelectionModel::setCurrentIndex(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMODELINDEX_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, (pyArgs[1])))) {
        overloadId = 0; // setCurrentIndex(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QModelIndex cppArg0_local;
        ::QModelIndex *cppArg0 = &cppArg0_local;
        if (pythonToCpp[0].isValue())
            pythonToCpp[0](pyArgs[0], &cppArg0_local);
        else
            pythonToCpp[0](pyArgs[0], &cppArg0);

        ::QFlags<QItemSelectionModel::SelectionFlag> cppArg1 = QFlags<QItemSelectionModel::SelectionFlag>(0);
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // setCurrentIndex(QModelIndex,QFlags<QItemSelectionModel::SelectionFlag>)
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QItemSelectionModel::setCurrentIndex(*cppArg0, cppArg1)
                : cppSelf->setCurrentIndex(*cppArg0, cppArg1);
        }
    }

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

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

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

    // Overloaded function decisor
    // 0: QItemSelectionModel::setModel(QAbstractItemModel*)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtCoreTypes[SBK_QABSTRACTITEMMODEL_IDX], (pyArg)))) {
        overloadId = 0; // setModel(QAbstractItemModel*)
    }

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

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

        if (!PyErr_Occurred()) {
            // setModel(QAbstractItemModel*)
            cppSelf->setModel(cppArg0);
        }
    }

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

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


static const char *Sbk_QItemSelectionModel_PropertyStrings[] = {
    "currentIndex:",
    "hasSelection:",
    "model::",
    "selectedIndexes:",
    "selection:",
    nullptr // Sentinel
};

static PyMethodDef Sbk_QItemSelectionModel_methods[] = {
    {"clear", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_clear), METH_NOARGS},
    {"clearCurrentIndex", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_clearCurrentIndex), METH_NOARGS},
    {"clearSelection", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_clearSelection), METH_NOARGS},
    {"columnIntersectsSelection", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_columnIntersectsSelection), METH_VARARGS|METH_KEYWORDS},
    {"currentIndex", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_currentIndex), METH_NOARGS},
    {"emitSelectionChanged", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_emitSelectionChanged), METH_VARARGS},
    {"hasSelection", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_hasSelection), METH_NOARGS},
    {"isColumnSelected", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_isColumnSelected), METH_VARARGS|METH_KEYWORDS},
    {"isRowSelected", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_isRowSelected), METH_VARARGS|METH_KEYWORDS},
    {"isSelected", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_isSelected), METH_O},
    {"model", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_model), METH_NOARGS},
    {"reset", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_reset), METH_NOARGS},
    {"rowIntersectsSelection", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_rowIntersectsSelection), METH_VARARGS|METH_KEYWORDS},
    {"select", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_select), METH_VARARGS},
    {"selectedColumns", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_selectedColumns), METH_VARARGS|METH_KEYWORDS},
    {"selectedIndexes", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_selectedIndexes), METH_NOARGS},
    {"selectedRows", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_selectedRows), METH_VARARGS|METH_KEYWORDS},
    {"selection", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_selection), METH_NOARGS},
    {"setCurrentIndex", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_setCurrentIndex), METH_VARARGS},
    {"setModel", reinterpret_cast<PyCFunction>(Sbk_QItemSelectionModelFunc_setModel), METH_O},

    {nullptr, nullptr} // Sentinel
};

static int Sbk_QItemSelectionModel_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value && PyCallable_Check(value)) {
        auto plain_inst = reinterpret_cast< ::QItemSelectionModel *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_IDX], reinterpret_cast<SbkObject *>(self)));
        auto inst = dynamic_cast<QItemSelectionModelWrapper *>(plain_inst);
        if (inst)
            inst->resetPyMethodCache();
    }
    Shiboken::AutoDecRef pp(reinterpret_cast<PyObject *>(PySide::Property::getObject(self, name)));
    if (!pp.isNull())
        return PySide::Property::setValue(reinterpret_cast<PySideProperty *>(pp.object()), self, value);
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

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

static PyType_Slot Sbk_QItemSelectionModel_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_QItemSelectionModel_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QItemSelectionModel_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QItemSelectionModel_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QItemSelectionModel_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QItemSelectionModel_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QItemSelectionModel_spec = {
    "2:PySide6.QtCore.QItemSelectionModel",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QItemSelectionModel_slots
};

} //extern "C"

static void *Sbk_QItemSelectionModel_typeDiscovery(void *cptr, PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QObject >())
        return dynamic_cast< ::QItemSelectionModel *>(reinterpret_cast< ::QObject *>(cptr));
    return {};
}

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

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

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

PyObject *SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag___invert__(PyObject *self, PyObject *pyArg)
{
    ::QItemSelectionModel::SelectionFlags cppSelf;
    Shiboken::Conversions::pythonToCppCopy(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, self, &cppSelf);
    ::QItemSelectionModel::SelectionFlags cppResult = ~cppSelf;
    return Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))->converter, &cppResult);
}

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

static PyType_Slot SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag_number_slots[] = {
    {Py_nb_bool,    reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag__nonzero)},
    {Py_nb_invert,  reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag___invert__)},
    {Py_nb_and,     reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag___and__)},
    {Py_nb_xor,     reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag___xor__)},
    {Py_nb_or,      reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag___or__)},
    {Py_nb_int,     reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag_long)},
    {Py_nb_index,   reinterpret_cast<void *>(SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag_long)},
    {0, nullptr} // sentinel
};



// Type conversion functions.

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

}
static PythonToCppFunc is_QItemSelectionModel_SelectionFlag_PythonToCpp_QItemSelectionModel_SelectionFlag_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))
        return QItemSelectionModel_SelectionFlag_PythonToCpp_QItemSelectionModel_SelectionFlag;
    return {};
}
static PyObject *QItemSelectionModel_SelectionFlag_CppToPython_QItemSelectionModel_SelectionFlag(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QItemSelectionModel::SelectionFlag *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX], castCppIn);

}

static void QFlags_QItemSelectionModel_SelectionFlag__PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QItemSelectionModel::SelectionFlag> *>(cppOut) =
        ::QFlags<QItemSelectionModel::SelectionFlag>(QFlag(int(PySide::QFlags::getValue(reinterpret_cast<PySideQFlagsObject *>(pyIn)))));

}
static PythonToCppFunc is_QFlags_QItemSelectionModel_SelectionFlag__PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))
        return QFlags_QItemSelectionModel_SelectionFlag__PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_;
    return {};
}
static PyObject *QFlags_QItemSelectionModel_SelectionFlag__CppToPython_QFlags_QItemSelectionModel_SelectionFlag_(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QFlags<QItemSelectionModel::SelectionFlag> *>(cppIn));
    return reinterpret_cast<PyObject *>(PySide::QFlags::newObject(castCppIn, SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]));

}

static void QItemSelectionModel_SelectionFlag_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QFlags<QItemSelectionModel::SelectionFlag> *>(cppOut) =
        ::QFlags<QItemSelectionModel::SelectionFlag>(QFlag(int(Shiboken::Enum::getValue(pyIn))));

}
static PythonToCppFunc is_QItemSelectionModel_SelectionFlag_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag__Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]))
        return QItemSelectionModel_SelectionFlag_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_;
    return {};
}
static void number_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_(PyObject *pyIn, void *cppOut)
{
    Shiboken::AutoDecRef pyLong(PyNumber_Long(pyIn));
    *reinterpret_cast<::QFlags<QItemSelectionModel::SelectionFlag> *>(cppOut) =
        ::QFlags<QItemSelectionModel::SelectionFlag>(QFlag(int(PyLong_AsLong(pyLong.object()))));

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QItemSelectionModel_PTR_CppToPython_QItemSelectionModel(const void *cppIn)
{
    return PySide::getWrapperForQObject(reinterpret_cast<::QItemSelectionModel *>(const_cast<void *>(cppIn)), Sbk_QItemSelectionModel_TypeF());

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QItemSelectionModel_SignatureStrings[] = {
    "1:PySide6.QtCore.QItemSelectionModel(self,model:PySide6.QtCore.QAbstractItemModel=nullptr)",
    "0:PySide6.QtCore.QItemSelectionModel(self,model:PySide6.QtCore.QAbstractItemModel,parent:PySide6.QtCore.QObject)",
    "PySide6.QtCore.QItemSelectionModel.clear(self)",
    "PySide6.QtCore.QItemSelectionModel.clearCurrentIndex(self)",
    "PySide6.QtCore.QItemSelectionModel.clearSelection(self)",
    "PySide6.QtCore.QItemSelectionModel.columnIntersectsSelection(self,column:int,parent:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]=QModelIndex())->bool",
    "PySide6.QtCore.QItemSelectionModel.currentIndex(self)->PySide6.QtCore.QModelIndex",
    "PySide6.QtCore.QItemSelectionModel.emitSelectionChanged(self,newSelection:PySide6.QtCore.QItemSelection,oldSelection:PySide6.QtCore.QItemSelection)",
    "PySide6.QtCore.QItemSelectionModel.hasSelection(self)->bool",
    "PySide6.QtCore.QItemSelectionModel.isColumnSelected(self,column:int,parent:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]=QModelIndex())->bool",
    "PySide6.QtCore.QItemSelectionModel.isRowSelected(self,row:int,parent:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]=QModelIndex())->bool",
    "PySide6.QtCore.QItemSelectionModel.isSelected(self,index:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex])->bool",
    "PySide6.QtCore.QItemSelectionModel.model(self)->PySide6.QtCore.QAbstractItemModel",
    "PySide6.QtCore.QItemSelectionModel.reset(self)",
    "PySide6.QtCore.QItemSelectionModel.rowIntersectsSelection(self,row:int,parent:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]=QModelIndex())->bool",
    "1:PySide6.QtCore.QItemSelectionModel.select(self,index:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex],command:PySide6.QtCore.QItemSelectionModel.SelectionFlags)",
    "0:PySide6.QtCore.QItemSelectionModel.select(self,selection:PySide6.QtCore.QItemSelection,command:PySide6.QtCore.QItemSelectionModel.SelectionFlags)",
    "PySide6.QtCore.QItemSelectionModel.selectedColumns(self,row:int=0)->QModelIndexList",
    "PySide6.QtCore.QItemSelectionModel.selectedIndexes(self)->QModelIndexList",
    "PySide6.QtCore.QItemSelectionModel.selectedRows(self,column:int=0)->QModelIndexList",
    "PySide6.QtCore.QItemSelectionModel.selection(self)->PySide6.QtCore.QItemSelection",
    "PySide6.QtCore.QItemSelectionModel.setCurrentIndex(self,index:typing.Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex],command:PySide6.QtCore.QItemSelectionModel.SelectionFlags)",
    "PySide6.QtCore.QItemSelectionModel.setModel(self,model:PySide6.QtCore.QAbstractItemModel)",
    nullptr}; // Sentinel

void init_QItemSelectionModel(PyObject *module)
{
    _Sbk_QItemSelectionModel_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QItemSelectionModel",
        "QItemSelectionModel*",
        &Sbk_QItemSelectionModel_spec,
        &Shiboken::callCppDestructor< ::QItemSelectionModel >,
        SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX],
        0,
        0);
    auto *pyType = Sbk_QItemSelectionModel_TypeF(); // references _Sbk_QItemSelectionModel_Type
    InitSignatureStrings(pyType, QItemSelectionModel_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QItemSelectionModel_Type), Sbk_QItemSelectionModel_PropertyStrings);
    SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_IDX]
        = Sbk_QItemSelectionModel_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QItemSelectionModel_TypeF(),
        QItemSelectionModel_PythonToCpp_QItemSelectionModel_PTR,
        is_QItemSelectionModel_PythonToCpp_QItemSelectionModel_PTR_Convertible,
        QItemSelectionModel_PTR_CppToPython_QItemSelectionModel);

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


    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_QItemSelectionModel_TypeF(), &Sbk_QItemSelectionModel_typeDiscovery);

    // Initialization of enums.

    // Initialization of enum 'SelectionFlag'.
    SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX] = PySide::QFlags::create("2:PySide6.QtCore.QItemSelectionModel.SelectionFlags", SbkPySide6_QtCore_QItemSelectionModel_SelectionFlag_number_slots);
    SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QItemSelectionModel_TypeF(),
        "SelectionFlag",
        "2:PySide6.QtCore.QItemSelectionModel.SelectionFlag",
        "QItemSelectionModel::SelectionFlag",
        SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX]);
    if (!SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "NoUpdate", (long) QItemSelectionModel::SelectionFlag::NoUpdate))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Clear", (long) QItemSelectionModel::SelectionFlag::Clear))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Select", (long) QItemSelectionModel::SelectionFlag::Select))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Deselect", (long) QItemSelectionModel::SelectionFlag::Deselect))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Toggle", (long) QItemSelectionModel::SelectionFlag::Toggle))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Current", (long) QItemSelectionModel::SelectionFlag::Current))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Rows", (long) QItemSelectionModel::SelectionFlag::Rows))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "Columns", (long) QItemSelectionModel::SelectionFlag::Columns))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "SelectCurrent", (long) QItemSelectionModel::SelectionFlag::SelectCurrent))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "ToggleCurrent", (long) QItemSelectionModel::SelectionFlag::ToggleCurrent))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
        Sbk_QItemSelectionModel_TypeF(), "ClearAndSelect", (long) QItemSelectionModel::SelectionFlag::ClearAndSelect))
        return;
    // Register converter for enum 'QItemSelectionModel::SelectionFlag'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
            QItemSelectionModel_SelectionFlag_CppToPython_QItemSelectionModel_SelectionFlag);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QItemSelectionModel_SelectionFlag_PythonToCpp_QItemSelectionModel_SelectionFlag,
            is_QItemSelectionModel_SelectionFlag_PythonToCpp_QItemSelectionModel_SelectionFlag_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtCoreTypes[SBK_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QItemSelectionModel::SelectionFlag");
        Shiboken::Conversions::registerConverterName(converter, "SelectionFlag");
    }
    // Register converter for flag 'QFlags<QItemSelectionModel::SelectionFlag>'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX],
            QFlags_QItemSelectionModel_SelectionFlag__CppToPython_QFlags_QItemSelectionModel_SelectionFlag_);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QItemSelectionModel_SelectionFlag_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_,
            is_QItemSelectionModel_SelectionFlag_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QFlags_QItemSelectionModel_SelectionFlag__PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_,
            is_QFlags_QItemSelectionModel_SelectionFlag__PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag__Convertible);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            number_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag_,
            is_number_PythonToCpp_QFlags_QItemSelectionModel_SelectionFlag__Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QITEMSELECTIONMODEL_SELECTIONFLAG_IDX], converter, true);
        Shiboken::Conversions::registerConverterName(converter, "QItemSelectionModel::SelectionFlags");
        Shiboken::Conversions::registerConverterName(converter, "SelectionFlags");
        Shiboken::Conversions::registerConverterName(converter, "QFlags<QItemSelectionModel::SelectionFlag>");
    }
    // End of 'SelectionFlag' enum/flags.

    PySide::Signal::registerSignals(Sbk_QItemSelectionModel_TypeF(), &::QItemSelectionModel::staticMetaObject);
    qRegisterMetaType< ::QItemSelectionModel::SelectionFlag >("QItemSelectionModel::SelectionFlag");
    qRegisterMetaType< ::QItemSelectionModel::SelectionFlags >("QItemSelectionModel::SelectionFlags");
    Shiboken::ObjectType::setSubTypeInitHook(Sbk_QItemSelectionModel_TypeF(), &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(Sbk_QItemSelectionModel_TypeF(), &::QItemSelectionModel::staticMetaObject, sizeof(QItemSelectionModelWrapper));
}
