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

//workaround to access protected functions
#define protected public

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

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtgui_python.h"

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

QMouseEventWrapper::QMouseEventWrapper(QEvent::Type type, const QPointF & localPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device) : QMouseEvent(type, localPos, button, buttons, modifiers, device)
{
    resetPyMethodCache();
    // ... middle
}

QMouseEventWrapper::QMouseEventWrapper(QEvent::Type type, const QPointF & localPos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device) : QMouseEvent(type, localPos, globalPos, button, buttons, modifiers, device)
{
    resetPyMethodCache();
    // ... middle
}

QMouseEventWrapper::QMouseEventWrapper(QEvent::Type type, const QPointF & localPos, const QPointF & scenePos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, Qt::MouseEventSource source, const QPointingDevice * device) : QMouseEvent(type, localPos, scenePos, globalPos, button, buttons, modifiers, source, device)
{
    resetPyMethodCache();
    // ... middle
}

QMouseEventWrapper::QMouseEventWrapper(QEvent::Type type, const QPointF & localPos, const QPointF & scenePos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device) : QMouseEvent(type, localPos, scenePos, globalPos, button, buttons, modifiers, device)
{
    resetPyMethodCache();
    // ... middle
}

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

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

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

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

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

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

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

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

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

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

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

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

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

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &accepted)
    ));

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

void QMouseEventWrapper::setTimestamp(quint64 timestamp)
{
    if (m_PyMethodCache[5]) {
        return this->::QPointerEvent::setTimestamp(timestamp);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setTimestamp";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[5] = true;
        return this->::QPointerEvent::setTimestamp(timestamp);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(K)",
        timestamp
    ));

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

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

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

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

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

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

    if (!PyArg_ParseTuple(args, "|OOOOOOOOO:QMouseEvent", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]), &(pyArgs[5]), &(pyArgs[6]), &(pyArgs[7]), &(pyArgs[8])))
        return -1;


    // Overloaded function decisor
    // 0: QMouseEvent::QMouseEvent(QEvent::Type,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
    // 1: QMouseEvent::QMouseEvent(QEvent::Type,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
    // 2: QMouseEvent::QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,Qt::MouseEventSource,const QPointingDevice*)
    // 3: QMouseEvent::QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
    // 4: QMouseEvent::QMouseEvent(QMouseEvent)
    if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QMOUSEEVENT_IDX], (pyArgs[0])))) {
        overloadId = 4; // QMouseEvent(QMouseEvent)
    } else if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QEVENT_TYPE_IDX]))->converter, (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArgs[1])))) {
        if (numArgs >= 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArgs[2])))) {
            if (numArgs >= 7
                && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], (pyArgs[3])))
                && (pythonToCpp[4] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[4])))
                && (pythonToCpp[5] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[5])))
                && (pythonToCpp[6] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_KEYBOARDMODIFIER_IDX]))->converter, (pyArgs[6])))) {
                if (numArgs == 7) {
                    overloadId = 3; // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                } else if (numArgs >= 8
                    && (pythonToCpp[7] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[7])))) {
                    overloadId = 3; // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                } else if (numArgs >= 8
                    && (pythonToCpp[7] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_MOUSEEVENTSOURCE_IDX]))->converter, (pyArgs[7])))) {
                    if (numArgs == 8) {
                        overloadId = 2; // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,Qt::MouseEventSource,const QPointingDevice*)
                    } else if (numArgs >= 9
                        && (pythonToCpp[8] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[8])))) {
                        overloadId = 2; // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,Qt::MouseEventSource,const QPointingDevice*)
                    }
                }
            } else if (numArgs >= 6
                && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[3])))
                && (pythonToCpp[4] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[4])))
                && (pythonToCpp[5] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_KEYBOARDMODIFIER_IDX]))->converter, (pyArgs[5])))) {
                if (numArgs == 6) {
                    overloadId = 1; // QMouseEvent(QEvent::Type,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                } else if (numArgs >= 7
                    && (pythonToCpp[6] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[6])))) {
                    overloadId = 1; // QMouseEvent(QEvent::Type,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                }
            }
        } else if (numArgs >= 5
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[2])))
            && (pythonToCpp[3] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_MOUSEBUTTON_IDX]))->converter, (pyArgs[3])))
            && (pythonToCpp[4] = Shiboken::Conversions::pythonToCppConversion(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_KEYBOARDMODIFIER_IDX]))->converter, (pyArgs[4])))) {
            if (numArgs == 5) {
                overloadId = 0; // QMouseEvent(QEvent::Type,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
            } else if (numArgs >= 6
                && (pythonToCpp[5] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[5])))) {
                overloadId = 0; // QMouseEvent(QEvent::Type,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
            }
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // QMouseEvent(QEvent::Type type, const QPointF & localPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_device = Shiboken::String::createStaticString("device");
                if (PyDict_Contains(kwds, key_device)) {
                    value = PyDict_GetItem(kwds, key_device);
                    if (value && pyArgs[5]) {
                        errInfo.reset(key_device);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[5] = value;
                        if (!(pythonToCpp[5] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[5]))))
                            goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_device);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QMouseEvent_Init_TypeError;
                }
            }
            ::QEvent::Type cppArg0{QEvent::None};
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            ::Qt::MouseButton cppArg2{Qt::NoButton};
            pythonToCpp[2](pyArgs[2], &cppArg2);
            ::QFlags<Qt::MouseButton> cppArg3 = QFlags<Qt::MouseButton>(0);
            pythonToCpp[3](pyArgs[3], &cppArg3);
            ::QFlags<Qt::KeyboardModifier> cppArg4 = QFlags<Qt::KeyboardModifier>(0);
            pythonToCpp[4](pyArgs[4], &cppArg4);
            if (!Shiboken::Object::isValid(pyArgs[5]))
                return -1;
            ::QPointingDevice *cppArg5 = const_cast<::QPointingDevice *>(QPointingDevice::primaryPointingDevice());
            if (pythonToCpp[5])
                pythonToCpp[5](pyArgs[5], &cppArg5);

            if (!PyErr_Occurred()) {
                // QMouseEvent(QEvent::Type,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                cptr = new ::QMouseEventWrapper(cppArg0, *cppArg1, cppArg2, cppArg3, cppArg4, cppArg5);
            }
            break;
        }
        case 1: // QMouseEvent(QEvent::Type type, const QPointF & localPos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_device = Shiboken::String::createStaticString("device");
                if (PyDict_Contains(kwds, key_device)) {
                    value = PyDict_GetItem(kwds, key_device);
                    if (value && pyArgs[6]) {
                        errInfo.reset(key_device);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[6] = value;
                        if (!(pythonToCpp[6] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[6]))))
                            goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_device);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QMouseEvent_Init_TypeError;
                }
            }
            ::QEvent::Type cppArg0{QEvent::None};
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!Shiboken::Object::isValid(pyArgs[2]))
                return -1;
            ::QPointF cppArg2_local;
            ::QPointF *cppArg2 = &cppArg2_local;
            if (pythonToCpp[2].isValue())
                pythonToCpp[2](pyArgs[2], &cppArg2_local);
            else
                pythonToCpp[2](pyArgs[2], &cppArg2);

            ::Qt::MouseButton cppArg3{Qt::NoButton};
            pythonToCpp[3](pyArgs[3], &cppArg3);
            ::QFlags<Qt::MouseButton> cppArg4 = QFlags<Qt::MouseButton>(0);
            pythonToCpp[4](pyArgs[4], &cppArg4);
            ::QFlags<Qt::KeyboardModifier> cppArg5 = QFlags<Qt::KeyboardModifier>(0);
            pythonToCpp[5](pyArgs[5], &cppArg5);
            if (!Shiboken::Object::isValid(pyArgs[6]))
                return -1;
            ::QPointingDevice *cppArg6 = const_cast<::QPointingDevice *>(QPointingDevice::primaryPointingDevice());
            if (pythonToCpp[6])
                pythonToCpp[6](pyArgs[6], &cppArg6);

            if (!PyErr_Occurred()) {
                // QMouseEvent(QEvent::Type,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                cptr = new ::QMouseEventWrapper(cppArg0, *cppArg1, *cppArg2, cppArg3, cppArg4, cppArg5, cppArg6);
            }
            break;
        }
        case 2: // QMouseEvent(QEvent::Type type, const QPointF & localPos, const QPointF & scenePos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, Qt::MouseEventSource source, const QPointingDevice * device)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_device = Shiboken::String::createStaticString("device");
                if (PyDict_Contains(kwds, key_device)) {
                    value = PyDict_GetItem(kwds, key_device);
                    if (value && pyArgs[8]) {
                        errInfo.reset(key_device);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[8] = value;
                        if (!(pythonToCpp[8] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[8]))))
                            goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_device);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QMouseEvent_Init_TypeError;
                }
            }
            ::QEvent::Type cppArg0{QEvent::None};
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!Shiboken::Object::isValid(pyArgs[2]))
                return -1;
            ::QPointF cppArg2_local;
            ::QPointF *cppArg2 = &cppArg2_local;
            if (pythonToCpp[2].isValue())
                pythonToCpp[2](pyArgs[2], &cppArg2_local);
            else
                pythonToCpp[2](pyArgs[2], &cppArg2);

            if (!Shiboken::Object::isValid(pyArgs[3]))
                return -1;
            ::QPointF cppArg3_local;
            ::QPointF *cppArg3 = &cppArg3_local;
            if (pythonToCpp[3].isValue())
                pythonToCpp[3](pyArgs[3], &cppArg3_local);
            else
                pythonToCpp[3](pyArgs[3], &cppArg3);

            ::Qt::MouseButton cppArg4{Qt::NoButton};
            pythonToCpp[4](pyArgs[4], &cppArg4);
            ::QFlags<Qt::MouseButton> cppArg5 = QFlags<Qt::MouseButton>(0);
            pythonToCpp[5](pyArgs[5], &cppArg5);
            ::QFlags<Qt::KeyboardModifier> cppArg6 = QFlags<Qt::KeyboardModifier>(0);
            pythonToCpp[6](pyArgs[6], &cppArg6);
            ::Qt::MouseEventSource cppArg7{Qt::MouseEventNotSynthesized};
            pythonToCpp[7](pyArgs[7], &cppArg7);
            if (!Shiboken::Object::isValid(pyArgs[8]))
                return -1;
            ::QPointingDevice *cppArg8 = const_cast<::QPointingDevice *>(QPointingDevice::primaryPointingDevice());
            if (pythonToCpp[8])
                pythonToCpp[8](pyArgs[8], &cppArg8);

            if (!PyErr_Occurred()) {
                // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,Qt::MouseEventSource,const QPointingDevice*)
                cptr = new ::QMouseEventWrapper(cppArg0, *cppArg1, *cppArg2, *cppArg3, cppArg4, cppArg5, cppArg6, cppArg7, cppArg8);
            }
            break;
        }
        case 3: // QMouseEvent(QEvent::Type type, const QPointF & localPos, const QPointF & scenePos, const QPointF & globalPos, Qt::MouseButton button, QFlags<Qt::MouseButton> buttons, QFlags<Qt::KeyboardModifier> modifiers, const QPointingDevice * device)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                PyObject *value{};
                Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
                static PyObject *const key_device = Shiboken::String::createStaticString("device");
                if (PyDict_Contains(kwds, key_device)) {
                    value = PyDict_GetItem(kwds, key_device);
                    if (value && pyArgs[7]) {
                        errInfo.reset(key_device);
                        Py_INCREF(errInfo.object());
                        goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    if (value) {
                        pyArgs[7] = value;
                        if (!(pythonToCpp[7] = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPOINTINGDEVICE_IDX], (pyArgs[7]))))
                            goto Sbk_QMouseEvent_Init_TypeError;
                    }
                    PyDict_DelItem(kwds_dup, key_device);
                }
                if (PyDict_Size(kwds_dup) > 0) {
                    errInfo.reset(kwds_dup.release());
                    goto Sbk_QMouseEvent_Init_TypeError;
                }
            }
            ::QEvent::Type cppArg0{QEvent::None};
            pythonToCpp[0](pyArgs[0], &cppArg0);
            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QPointF cppArg1_local;
            ::QPointF *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (!Shiboken::Object::isValid(pyArgs[2]))
                return -1;
            ::QPointF cppArg2_local;
            ::QPointF *cppArg2 = &cppArg2_local;
            if (pythonToCpp[2].isValue())
                pythonToCpp[2](pyArgs[2], &cppArg2_local);
            else
                pythonToCpp[2](pyArgs[2], &cppArg2);

            if (!Shiboken::Object::isValid(pyArgs[3]))
                return -1;
            ::QPointF cppArg3_local;
            ::QPointF *cppArg3 = &cppArg3_local;
            if (pythonToCpp[3].isValue())
                pythonToCpp[3](pyArgs[3], &cppArg3_local);
            else
                pythonToCpp[3](pyArgs[3], &cppArg3);

            ::Qt::MouseButton cppArg4{Qt::NoButton};
            pythonToCpp[4](pyArgs[4], &cppArg4);
            ::QFlags<Qt::MouseButton> cppArg5 = QFlags<Qt::MouseButton>(0);
            pythonToCpp[5](pyArgs[5], &cppArg5);
            ::QFlags<Qt::KeyboardModifier> cppArg6 = QFlags<Qt::KeyboardModifier>(0);
            pythonToCpp[6](pyArgs[6], &cppArg6);
            if (!Shiboken::Object::isValid(pyArgs[7]))
                return -1;
            ::QPointingDevice *cppArg7 = const_cast<::QPointingDevice *>(QPointingDevice::primaryPointingDevice());
            if (pythonToCpp[7])
                pythonToCpp[7](pyArgs[7], &cppArg7);

            if (!PyErr_Occurred()) {
                // QMouseEvent(QEvent::Type,QPointF,QPointF,QPointF,Qt::MouseButton,QFlags<Qt::MouseButton>,QFlags<Qt::KeyboardModifier>,const QPointingDevice*)
                cptr = new ::QMouseEventWrapper(cppArg0, *cppArg1, *cppArg2, *cppArg3, cppArg4, cppArg5, cppArg6, cppArg7);
            }
            break;
        }
        case 4: // QMouseEvent(const QMouseEvent & arg__1)
        {
            if (kwds && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                goto Sbk_QMouseEvent_Init_TypeError;
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QMouseEvent *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

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

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

    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::Object::setHasCppWrapper(sbkSelf, true);
    if (Shiboken::BindingManager::instance().hasWrapper(cptr)) {
        Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr));
    }
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // __repr__()
            // Begin code injection
            // TEMPLATE - repr_qdebug_gui - START
            // TEMPLATE - repr_qdebug - START
            QString result;
            QDebug(&result).nospace() << "<PySide6.QtGui." << cppSelf << '>';
            pyResult = Shiboken::String::fromCString(qPrintable(result));
            // TEMPLATE - repr_qdebug - END
            // TEMPLATE - repr_qdebug_gui - END
            // End of code injection

        }
    }

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // clone()const
            QMouseEvent * cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? const_cast<const ::QMouseEvent *>(cppSelf)->::QMouseEvent::clone()
                : const_cast<const ::QMouseEvent *>(cppSelf)->clone();
            pyResult = Shiboken::Conversions::pointerToPython(SbkPySide6_QtGuiTypes[SBK_QMOUSEEVENT_IDX], cppResult);
            Shiboken::Object::setParent(self, pyResult);
        }
    }

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // flags()const
            QFlags<Qt::MouseEventFlag> cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->flags();
            pyResult = Shiboken::Conversions::copyToPython(PepType_PFTP(reinterpret_cast<PySideQFlagsType *>(SbkPySide6_QtCoreTypes[SBK_QFLAGS_QT_MOUSEEVENTFLAG_IDX]))->converter, &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'globalPos() const' is marked as deprecated, please check the documentation for more information.");

        if (!PyErr_Occurred()) {
            // globalPos()const
            QPoint cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->globalPos();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'globalX() const' is marked as deprecated, please check the documentation for more information.");

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

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'globalY() const' is marked as deprecated, please check the documentation for more information.");

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

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'localPos() const' is marked as deprecated, please check the documentation for more information.");

        if (!PyErr_Occurred()) {
            // localPos()const
            QPointF cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->localPos();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'pos() const' is marked as deprecated, please check the documentation for more information.");

        if (!PyErr_Occurred()) {
            // pos()const
            QPoint cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->pos();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'screenPos() const' is marked as deprecated, please check the documentation for more information.");

        if (!PyErr_Occurred()) {
            // screenPos()const
            QPointF cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->screenPos();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], &cppResult);
        }
    }

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

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

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // source()const
            Qt::MouseEventSource cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->source();
            pyResult = Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtCoreTypes[SBK_QT_MOUSEEVENTSOURCE_IDX]))->converter, &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'windowPos() const' is marked as deprecated, please check the documentation for more information.");

        if (!PyErr_Occurred()) {
            // windowPos()const
            QPointF cppResult = const_cast<const ::QMouseEvent *>(cppSelf)->windowPos();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QPOINTF_IDX], &cppResult);
        }
    }

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'x() const' is marked as deprecated, please check the documentation for more information.");

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

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

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

    // Call function/method
    {
        Shiboken::warning(PyExc_DeprecationWarning, 1, "Function: 'y() const' is marked as deprecated, please check the documentation for more information.");

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

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


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

static PyMethodDef Sbk_QMouseEvent_methods[] = {
    {"clone", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_clone), METH_NOARGS},
    {"flags", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_flags), METH_NOARGS},
    {"globalPos", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_globalPos), METH_NOARGS},
    {"globalX", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_globalX), METH_NOARGS},
    {"globalY", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_globalY), METH_NOARGS},
    {"localPos", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_localPos), METH_NOARGS},
    {"pos", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_pos), METH_NOARGS},
    {"screenPos", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_screenPos), METH_NOARGS},
    {"source", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_source), METH_NOARGS},
    {"windowPos", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_windowPos), METH_NOARGS},
    {"x", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_x), METH_NOARGS},
    {"y", reinterpret_cast<PyCFunction>(Sbk_QMouseEventFunc_y), METH_NOARGS},

    {nullptr, nullptr} // Sentinel
};

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

} // extern "C"

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

static PyType_Slot Sbk_QMouseEvent_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        reinterpret_cast<void *>(Sbk_QMouseEventFunc___repr__)},
    {Py_tp_hash,        nullptr},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_QMouseEvent_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QMouseEvent_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QMouseEvent_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QMouseEvent_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QMouseEvent_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QMouseEvent_spec = {
    "2:PySide6.QtGui.QMouseEvent",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QMouseEvent_slots
};

} //extern "C"

static void *Sbk_QMouseEvent_typeDiscovery(void *cptr, PyTypeObject *instanceType)
{
     if ( reinterpret_cast< ::QMouseEvent *>(cptr)->type() == QEvent::MouseButtonDblClick ||  reinterpret_cast< ::QMouseEvent *>(cptr)->type() == QEvent::MouseButtonPress ||  reinterpret_cast< ::QMouseEvent *>(cptr)->type() == QEvent::MouseButtonRelease ||  reinterpret_cast< ::QMouseEvent *>(cptr)->type() == QEvent::MouseMove)
        return cptr;
    return {};
}


// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QMouseEvent_PTR_CppToPython_QMouseEvent(const void *cppIn)
{
    auto pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    bool changedTypeName = false;
    auto tCppIn = reinterpret_cast<const ::QMouseEvent *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName);
    if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) {
        typeName = typeNameOf(tCppIn);
        changedTypeName = true;
    }
    PyObject *result = Shiboken::Object::newObject(Sbk_QMouseEvent_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QMouseEvent_SignatureStrings[] = {
    "4:PySide6.QtGui.QMouseEvent(self,type:PySide6.QtCore.QEvent.Type,localPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],button:PySide6.QtCore.Qt.MouseButton,buttons:PySide6.QtCore.Qt.MouseButtons,modifiers:PySide6.QtCore.Qt.KeyboardModifiers,device:PySide6.QtGui.QPointingDevice=QPointingDevice.primaryPointingDevice())",
    "3:PySide6.QtGui.QMouseEvent(self,type:PySide6.QtCore.QEvent.Type,localPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],globalPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],button:PySide6.QtCore.Qt.MouseButton,buttons:PySide6.QtCore.Qt.MouseButtons,modifiers:PySide6.QtCore.Qt.KeyboardModifiers,device:PySide6.QtGui.QPointingDevice=QPointingDevice.primaryPointingDevice())",
    "2:PySide6.QtGui.QMouseEvent(self,type:PySide6.QtCore.QEvent.Type,localPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],scenePos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],globalPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],button:PySide6.QtCore.Qt.MouseButton,buttons:PySide6.QtCore.Qt.MouseButtons,modifiers:PySide6.QtCore.Qt.KeyboardModifiers,source:PySide6.QtCore.Qt.MouseEventSource,device:PySide6.QtGui.QPointingDevice=QPointingDevice.primaryPointingDevice())",
    "1:PySide6.QtGui.QMouseEvent(self,type:PySide6.QtCore.QEvent.Type,localPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],scenePos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],globalPos:typing.Union[PySide6.QtCore.QPointF, PySide6.QtCore.QPoint, PySide6.QtGui.QPainterPath.Element],button:PySide6.QtCore.Qt.MouseButton,buttons:PySide6.QtCore.Qt.MouseButtons,modifiers:PySide6.QtCore.Qt.KeyboardModifiers,device:PySide6.QtGui.QPointingDevice=QPointingDevice.primaryPointingDevice())",
    "0:PySide6.QtGui.QMouseEvent(self,arg__1:PySide6.QtGui.QMouseEvent)",
    "PySide6.QtGui.QMouseEvent.__repr__(self)->PyObject",
    "PySide6.QtGui.QMouseEvent.clone(self)->PySide6.QtGui.QMouseEvent",
    "PySide6.QtGui.QMouseEvent.flags(self)->PySide6.QtCore.Qt.MouseEventFlags",
    "PySide6.QtGui.QMouseEvent.globalPos(self)->PySide6.QtCore.QPoint",
    "PySide6.QtGui.QMouseEvent.globalX(self)->int",
    "PySide6.QtGui.QMouseEvent.globalY(self)->int",
    "PySide6.QtGui.QMouseEvent.localPos(self)->PySide6.QtCore.QPointF",
    "PySide6.QtGui.QMouseEvent.pos(self)->PySide6.QtCore.QPoint",
    "PySide6.QtGui.QMouseEvent.screenPos(self)->PySide6.QtCore.QPointF",
    "PySide6.QtGui.QMouseEvent.source(self)->PySide6.QtCore.Qt.MouseEventSource",
    "PySide6.QtGui.QMouseEvent.windowPos(self)->PySide6.QtCore.QPointF",
    "PySide6.QtGui.QMouseEvent.x(self)->int",
    "PySide6.QtGui.QMouseEvent.y(self)->int",
    nullptr}; // Sentinel

void init_QMouseEvent(PyObject *module)
{
    _Sbk_QMouseEvent_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QMouseEvent",
        "QMouseEvent*",
        &Sbk_QMouseEvent_spec,
        &Shiboken::callCppDestructor< ::QMouseEvent >,
        SbkPySide6_QtGuiTypes[SBK_QSINGLEPOINTEVENT_IDX],
        0,
        0);
    auto *pyType = Sbk_QMouseEvent_TypeF(); // references _Sbk_QMouseEvent_Type
    InitSignatureStrings(pyType, QMouseEvent_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QMouseEvent_Type), Sbk_QMouseEvent_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QMOUSEEVENT_IDX]
        = Sbk_QMouseEvent_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QMouseEvent_TypeF(),
        QMouseEvent_PythonToCpp_QMouseEvent_PTR,
        is_QMouseEvent_PythonToCpp_QMouseEvent_PTR_Convertible,
        QMouseEvent_PTR_CppToPython_QMouseEvent);

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


    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_QMouseEvent_TypeF(), &Sbk_QMouseEvent_typeDiscovery);

}
