/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtCore.h"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qeventloop.sip"
#include <qeventloop.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobject.sip"
#include <qobject.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qeventloop.sip"
#include <qeventloop.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 146 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 44 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 47 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 247 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 50 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 235 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 53 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 56 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 59 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 62 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 65 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 149 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 68 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 71 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qthread.sip"
#include <qthread.h>
#line 74 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 77 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qregexp.sip"
#include <qregexp.h>
#line 80 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qregularexpression.sip"
#include <qregularexpression.h>
#line 83 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 86 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQEventLoop.cpp"


class sipQEventLoop : public  ::QEventLoop
{
public:
    sipQEventLoop( ::QObject*);
    virtual ~sipQEventLoop();

    int qt_metacall(QMetaObject::Call, int, void **) SIP_OVERRIDE;
    void *qt_metacast(const char *) SIP_OVERRIDE;
    const QMetaObject *metaObject() const SIP_OVERRIDE;

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool event( ::QEvent*) SIP_OVERRIDE;
    bool eventFilter( ::QObject*, ::QEvent*) SIP_OVERRIDE;
    void timerEvent( ::QTimerEvent*) SIP_OVERRIDE;
    void childEvent( ::QChildEvent*) SIP_OVERRIDE;
    void customEvent( ::QEvent*) SIP_OVERRIDE;
    void connectNotify(const  ::QMetaMethod&) SIP_OVERRIDE;
    void disconnectNotify(const  ::QMetaMethod&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQEventLoop(const sipQEventLoop &);
    sipQEventLoop &operator = (const sipQEventLoop &);

    char sipPyMethods[7];
};

sipQEventLoop::sipQEventLoop( ::QObject*a0):  ::QEventLoop(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQEventLoop::~sipQEventLoop()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

const QMetaObject *sipQEventLoop::metaObject() const
{
    if (sipGetInterpreter())
        return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : sip_QtCore_qt_metaobject(sipPySelf,sipType_QEventLoop);

    return  ::QEventLoop::metaObject();
}

int sipQEventLoop::qt_metacall(QMetaObject::Call _c,int _id,void **_a)
{
    _id =  ::QEventLoop::qt_metacall(_c,_id,_a);

    if (_id >= 0)
    {
        SIP_BLOCK_THREADS
        _id = sip_QtCore_qt_metacall(sipPySelf,sipType_QEventLoop,_c,_id,_a);
        SIP_UNBLOCK_THREADS
    }

    return _id;
}

void *sipQEventLoop::qt_metacast(const char *_clname)
{
    void *sipCpp;

    return (sip_QtCore_qt_metacast(sipPySelf, sipType_QEventLoop, _clname, &sipCpp) ? sipCpp :  ::QEventLoop::qt_metacast(_clname));
}

bool sipQEventLoop::event( ::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_event);

    if (!sipMeth)
        return  ::QEventLoop::event(a0);

    extern bool sipVH_QtCore_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QEvent*);

    return sipVH_QtCore_0(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

bool sipQEventLoop::eventFilter( ::QObject*a0, ::QEvent*a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_eventFilter);

    if (!sipMeth)
        return  ::QEventLoop::eventFilter(a0,a1);

    extern bool sipVH_QtCore_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QObject*, ::QEvent*);

    return sipVH_QtCore_1(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0, a1);
}

void sipQEventLoop::timerEvent( ::QTimerEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_timerEvent);

    if (!sipMeth)
    {
         ::QEventLoop::timerEvent(a0);
        return;
    }

    extern void sipVH_QtCore_2(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QTimerEvent*);

    sipVH_QtCore_2(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQEventLoop::childEvent( ::QChildEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_childEvent);

    if (!sipMeth)
    {
         ::QEventLoop::childEvent(a0);
        return;
    }

    extern void sipVH_QtCore_3(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QChildEvent*);

    sipVH_QtCore_3(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQEventLoop::customEvent( ::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, SIP_NULLPTR, sipName_customEvent);

    if (!sipMeth)
    {
         ::QEventLoop::customEvent(a0);
        return;
    }

    extern void sipVH_QtCore_4(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QEvent*);

    sipVH_QtCore_4(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQEventLoop::connectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, SIP_NULLPTR, sipName_connectNotify);

    if (!sipMeth)
    {
         ::QEventLoop::connectNotify(a0);
        return;
    }

    extern void sipVH_QtCore_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QMetaMethod&);

    sipVH_QtCore_5(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}

void sipQEventLoop::disconnectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_disconnectNotify);

    if (!sipMeth)
    {
         ::QEventLoop::disconnectNotify(a0);
        return;
    }

    extern void sipVH_QtCore_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QMetaMethod&);

    sipVH_QtCore_5(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth, a0);
}


PyDoc_STRVAR(doc_QEventLoop_processEvents, "processEvents(self, flags: Union[QEventLoop.ProcessEventsFlags, QEventLoop.ProcessEventsFlag] = QEventLoop.AllEvents) -> bool\n"
"processEvents(self, Union[QEventLoop.ProcessEventsFlags, QEventLoop.ProcessEventsFlag], int)");

extern "C" {static PyObject *meth_QEventLoop_processEvents(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_processEvents(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QEventLoop::ProcessEventsFlags a0def = QEventLoop::AllEvents;
         ::QEventLoop::ProcessEventsFlags* a0 = &a0def;
        int a0State = 0;
         ::QEventLoop *sipCpp;

        static const char *sipKwdList[] = {
            sipName_flags,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|J1", &sipSelf, sipType_QEventLoop, &sipCpp, sipType_QEventLoop_ProcessEventsFlags, &a0, &a0State))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->processEvents(*a0);
            Py_END_ALLOW_THREADS
            sipReleaseType(a0, sipType_QEventLoop_ProcessEventsFlags, a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    {
         ::QEventLoop::ProcessEventsFlags* a0;
        int a0State = 0;
        int a1;
         ::QEventLoop *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "BJ1i", &sipSelf, sipType_QEventLoop, &sipCpp, sipType_QEventLoop_ProcessEventsFlags, &a0, &a0State, &a1))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->processEvents(*a0,a1);
            Py_END_ALLOW_THREADS
            sipReleaseType(a0, sipType_QEventLoop_ProcessEventsFlags, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_processEvents, doc_QEventLoop_processEvents);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_exec_, "exec_(self, flags: QEventLoop.ProcessEventsFlags = QEventLoop.AllEvents) -> int");

extern "C" {static PyObject *meth_QEventLoop_exec_(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_exec_(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QEventLoop::ProcessEventsFlags a0def =  ::QEventLoop::AllEvents;
         ::QEventLoop::ProcessEventsFlags* a0 = &a0def;
        int a0State = 0;
         ::QEventLoop *sipCpp;

        static const char *sipKwdList[] = {
            sipName_flags,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|J1", &sipSelf, sipType_QEventLoop, &sipCpp, sipType_QEventLoop_ProcessEventsFlags, &a0, &a0State))
        {
            int sipRes;

            sipCallHook("__pyQtPreEventLoopHook__");

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->exec(*a0);
            Py_END_ALLOW_THREADS
            sipReleaseType(a0, sipType_QEventLoop_ProcessEventsFlags, a0State);


            sipCallHook("__pyQtPostEventLoopHook__");
            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_exec_, doc_QEventLoop_exec_);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_exec, "exec(self, flags: QEventLoop.ProcessEventsFlags = QEventLoop.AllEvents) -> int");

extern "C" {static PyObject *meth_QEventLoop_exec(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_exec(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QEventLoop::ProcessEventsFlags a0def =  ::QEventLoop::AllEvents;
         ::QEventLoop::ProcessEventsFlags* a0 = &a0def;
        int a0State = 0;
         ::QEventLoop *sipCpp;

        static const char *sipKwdList[] = {
            sipName_flags,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|J1", &sipSelf, sipType_QEventLoop, &sipCpp, sipType_QEventLoop_ProcessEventsFlags, &a0, &a0State))
        {
            int sipRes;

            sipCallHook("__pyQtPreEventLoopHook__");

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->exec(*a0);
            Py_END_ALLOW_THREADS
            sipReleaseType(a0, sipType_QEventLoop_ProcessEventsFlags, a0State);


            sipCallHook("__pyQtPostEventLoopHook__");
            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_exec, doc_QEventLoop_exec);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_exit, "exit(self, returnCode: int = 0)");

extern "C" {static PyObject *meth_QEventLoop_exit(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_exit(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0 = 0;
         ::QEventLoop *sipCpp;

        static const char *sipKwdList[] = {
            sipName_returnCode,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|i", &sipSelf, sipType_QEventLoop, &sipCpp, &a0))
        {
            sipCpp->exit(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_exit, doc_QEventLoop_exit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_isRunning, "isRunning(self) -> bool");

extern "C" {static PyObject *meth_QEventLoop_isRunning(PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_isRunning(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QEventLoop *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QEventLoop, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->isRunning();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_isRunning, doc_QEventLoop_isRunning);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_wakeUp, "wakeUp(self)");

extern "C" {static PyObject *meth_QEventLoop_wakeUp(PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_wakeUp(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QEventLoop *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QEventLoop, &sipCpp))
        {
            sipCpp->wakeUp();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_wakeUp, doc_QEventLoop_wakeUp);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_quit, "quit(self)");

extern "C" {static PyObject *meth_QEventLoop_quit(PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_quit(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QEventLoop *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QEventLoop, &sipCpp))
        {
            sipCpp->quit();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_quit, doc_QEventLoop_quit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QEventLoop_event, "event(self, QEvent) -> bool");

extern "C" {static PyObject *meth_QEventLoop_event(PyObject *, PyObject *);}
static PyObject *meth_QEventLoop_event(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
         ::QEvent* a0;
         ::QEventLoop *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QEventLoop, &sipCpp, sipType_QEvent, &a0))
        {
            bool sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QEventLoop::event(a0) : sipCpp->event(a0));

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QEventLoop, sipName_event, doc_QEventLoop_event);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QEventLoop(void *, const sipTypeDef *);}
static void *cast_QEventLoop(void *sipCppV, const sipTypeDef *targetType)
{
     ::QEventLoop *sipCpp = reinterpret_cast< ::QEventLoop *>(sipCppV);

    if (targetType == sipType_QEventLoop)
        return sipCppV;

    if (targetType == sipType_QObject)
        return static_cast< ::QObject *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QEventLoop(void *, int);}
static void release_QEventLoop(void *sipCppV, int)
{
     ::QEventLoop *sipCpp = reinterpret_cast< ::QEventLoop *>(sipCppV);

    if (QThread::currentThread() == sipCpp->thread())
        delete sipCpp;
    else
        sipCpp->deleteLater();
}


extern "C" {static void *array_QEventLoop(Py_ssize_t);}
static void *array_QEventLoop(Py_ssize_t sipNrElem)
{
    return new  ::QEventLoop[sipNrElem];
}


extern "C" {static void array_delete_QEventLoop(void *);}
static void array_delete_QEventLoop(void *sipCpp)
{
    delete[] reinterpret_cast< ::QEventLoop *>(sipCpp);
}


extern "C" {static void dealloc_QEventLoop(sipSimpleWrapper *);}
static void dealloc_QEventLoop(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQEventLoop *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QEventLoop(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QEventLoop(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QEventLoop(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **sipOwner, PyObject **sipParseErr)
{
    sipQEventLoop *sipCpp = SIP_NULLPTR;

    {
         ::QObject* a0 = 0;

        static const char *sipKwdList[] = {
            sipName_parent,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|JH", sipType_QObject, &a0, sipOwner))
        {
            sipCpp = new sipQEventLoop(a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QEventLoop[] = {{191, 255, 1}};


static PyMethodDef methods_QEventLoop[] = {
    {sipName_event, meth_QEventLoop_event, METH_VARARGS, doc_QEventLoop_event},
    {sipName_exec, SIP_MLMETH_CAST(meth_QEventLoop_exec), METH_VARARGS|METH_KEYWORDS, doc_QEventLoop_exec},
    {sipName_exec_, SIP_MLMETH_CAST(meth_QEventLoop_exec_), METH_VARARGS|METH_KEYWORDS, doc_QEventLoop_exec_},
    {sipName_exit, SIP_MLMETH_CAST(meth_QEventLoop_exit), METH_VARARGS|METH_KEYWORDS, doc_QEventLoop_exit},
    {sipName_isRunning, meth_QEventLoop_isRunning, METH_VARARGS, doc_QEventLoop_isRunning},
    {sipName_processEvents, SIP_MLMETH_CAST(meth_QEventLoop_processEvents), METH_VARARGS|METH_KEYWORDS, doc_QEventLoop_processEvents},
    {sipName_quit, meth_QEventLoop_quit, METH_VARARGS, doc_QEventLoop_quit},
    {sipName_wakeUp, meth_QEventLoop_wakeUp, METH_VARARGS, doc_QEventLoop_wakeUp}
};

static sipEnumMemberDef enummembers_QEventLoop[] = {
    {sipName_AllEvents, static_cast<int>( ::QEventLoop::AllEvents), 79},
    {sipName_ExcludeSocketNotifiers, static_cast<int>( ::QEventLoop::ExcludeSocketNotifiers), 79},
    {sipName_ExcludeUserInputEvents, static_cast<int>( ::QEventLoop::ExcludeUserInputEvents), 79},
    {sipName_WaitForMoreEvents, static_cast<int>( ::QEventLoop::WaitForMoreEvents), 79},
    {sipName_X11ExcludeTimers, static_cast<int>( ::QEventLoop::X11ExcludeTimers), 79},
};

PyDoc_STRVAR(doc_QEventLoop, "\1QEventLoop(parent: QObject = None)");


static pyqt5ClassPluginDef plugin_QEventLoop = {
    & ::QEventLoop::staticMetaObject,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QEventLoop = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QEventLoop,
        SIP_NULLPTR,
        &plugin_QEventLoop
    },
    {
        sipNameNr_QEventLoop,
        {0, 0, 1},
        8, methods_QEventLoop,
        5, enummembers_QEventLoop,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QEventLoop,
    -1,
    -1,
    supers_QEventLoop,
    SIP_NULLPTR,
    init_type_QEventLoop,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QEventLoop,
    SIP_NULLPTR,
    array_QEventLoop,
    SIP_NULLPTR,
    release_QEventLoop,
    cast_QEventLoop,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QEventLoop,
    sizeof ( ::QEventLoop),
};
