/*
 * 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/qthread.sip"
#include <qthread.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.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/sipQtCoreQThread.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qabstracteventdispatcher.sip"
#include <qabstracteventdispatcher.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qdeadlinetimer.sip"
#include <qdeadlinetimer.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.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 47 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 50 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 247 "/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/sipQtCoreQThread.cpp"
#line 235 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 56 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 59 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 62 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 65 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 68 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 149 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 71 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 74 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQThread.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/sipQtCoreQThread.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/sipQtCoreQThread.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/sipQtCoreQThread.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/sipQtCoreQThread.cpp"


class sipQThread : public  ::QThread
{
public:
    sipQThread( ::QObject*);
    virtual ~sipQThread();

    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:
    void run() SIP_OVERRIDE;
    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:
    sipQThread(const sipQThread &);
    sipQThread &operator = (const sipQThread &);

    char sipPyMethods[8];
};

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

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

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

    return  ::QThread::metaObject();
}

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

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

    return _id;
}

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

    return (sip_QtCore_qt_metacast(sipPySelf, sipType_QThread, _clname, &sipCpp) ? sipCpp :  ::QThread::qt_metacast(_clname));
}

void sipQThread::run()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::run();
        sipEndThread();
        return;
    }

    extern void sipVH_QtCore_17(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH_QtCore_17(sipGILState, sipVEH_QtCore_PyQt5, sipPySelf, sipMeth);

    sipEndThread();
}

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

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

    if (!sipMeth)
        return  ::QThread::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 sipQThread::eventFilter( ::QObject*a0, ::QEvent*a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QThread::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 sipQThread::timerEvent( ::QTimerEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::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 sipQThread::childEvent( ::QChildEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::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 sipQThread::customEvent( ::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::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 sipQThread::connectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::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 sipQThread::disconnectNotify(const  ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QThread::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_QThread_currentThread, "currentThread() -> QThread");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
             ::QThread*sipRes;

            sipRes =  ::QThread::currentThread();

            return sipConvertFromType(sipRes,sipType_QThread,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_currentThread, doc_QThread_currentThread);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_currentThreadId, "currentThreadId() -> PyQt5.sip.voidptr");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
             ::Qt::HANDLE sipRes;

            sipRes =  ::QThread::currentThreadId();

            return sipConvertFromVoidPtr((void *)sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_currentThreadId, doc_QThread_currentThreadId);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_idealThreadCount, "idealThreadCount() -> int");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
            int sipRes;

            sipRes =  ::QThread::idealThreadCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_idealThreadCount, doc_QThread_idealThreadCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_yieldCurrentThread, "yieldCurrentThread()");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
            Py_BEGIN_ALLOW_THREADS
             ::QThread::yieldCurrentThread();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_yieldCurrentThread, doc_QThread_yieldCurrentThread);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_isFinished, "isFinished(self) -> bool");

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

    {
        const  ::QThread *sipCpp;

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

            sipRes = sipCpp->isFinished();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_isFinished, doc_QThread_isFinished);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::QThread *sipCpp;

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

            sipRes = sipCpp->isRunning();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_isRunning, doc_QThread_isRunning);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_setPriority, "setPriority(self, QThread.Priority)");

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

    {
         ::QThread::Priority a0;
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BE", &sipSelf, sipType_QThread, &sipCpp, sipType_QThread_Priority, &a0))
        {
            sipCpp->setPriority(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_setPriority, doc_QThread_setPriority);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_priority, "priority(self) -> QThread.Priority");

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

    {
        const  ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThread, &sipCpp))
        {
             ::QThread::Priority sipRes;

            sipRes = sipCpp->priority();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QThread_Priority);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_priority, doc_QThread_priority);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_setStackSize, "setStackSize(self, int)");

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

    {
         ::uint a0;
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bu", &sipSelf, sipType_QThread, &sipCpp, &a0))
        {
            sipCpp->setStackSize(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_setStackSize, doc_QThread_setStackSize);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_stackSize, "stackSize(self) -> int");

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

    {
        const  ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThread, &sipCpp))
        {
             ::uint sipRes;

            sipRes = sipCpp->stackSize();

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_stackSize, doc_QThread_stackSize);

    return SIP_NULLPTR;
}


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

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

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

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

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_exit, doc_QThread_exit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_start, "start(self, priority: QThread.Priority = QThread.InheritPriority)");

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

    {
         ::QThread::Priority a0 = QThread::InheritPriority;
         ::QThread *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_QThread, &sipCpp, sipType_QThread_Priority, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->start(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_start, doc_QThread_start);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_terminate, "terminate(self)");

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

    {
         ::QThread *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_terminate, doc_QThread_terminate);

    return SIP_NULLPTR;
}


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

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

    {
         ::QThread *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_quit, doc_QThread_quit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_wait, "wait(self, msecs: int = ULONG_MAX) -> bool\n"
"wait(self, QDeadlineTimer) -> bool");

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

    {
        unsigned long a0 = ULONG_MAX;
         ::QThread *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|m", &sipSelf, sipType_QThread, &sipCpp, &a0))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->wait(a0);
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

    {
         ::QDeadlineTimer* a0;
         ::QThread *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "BJ9", &sipSelf, sipType_QThread, &sipCpp, sipType_QDeadlineTimer, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->wait(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_wait, doc_QThread_wait);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_run, "run(self)");

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

    {
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "p", &sipSelf, sipType_QThread, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp-> ::QThread::run() : sipCpp->run());
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_run, doc_QThread_run);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_exec_, "exec_(self) -> int");

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

    {
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "p", &sipSelf, sipType_QThread, &sipCpp))
        {
            int sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->exec();
            Py_END_ALLOW_THREADS

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_exec_, doc_QThread_exec_);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_exec, "exec(self) -> int");

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

    {
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "p", &sipSelf, sipType_QThread, &sipCpp))
        {
            int sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->exec();
            Py_END_ALLOW_THREADS

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_exec, doc_QThread_exec);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_setTerminationEnabled, "setTerminationEnabled(enabled: bool = True)");

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

    {
        bool a0 = 1;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "|b", &a0))
        {
             ::QThread::setTerminationEnabled(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_setTerminationEnabled, doc_QThread_setTerminationEnabled);

    return SIP_NULLPTR;
}


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

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

    {
         ::QEvent* a0;
         ::QThread *sipCpp;

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

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

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_event, doc_QThread_event);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_sleep, "sleep(int)");

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

    {
        unsigned long a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "m", &a0))
        {
            Py_BEGIN_ALLOW_THREADS
             ::QThread::sleep(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_sleep, doc_QThread_sleep);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_msleep, "msleep(int)");

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

    {
        unsigned long a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "m", &a0))
        {
            Py_BEGIN_ALLOW_THREADS
             ::QThread::msleep(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_msleep, doc_QThread_msleep);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_usleep, "usleep(int)");

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

    {
        unsigned long a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "m", &a0))
        {
            Py_BEGIN_ALLOW_THREADS
             ::QThread::usleep(a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_usleep, doc_QThread_usleep);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_eventDispatcher, "eventDispatcher(self) -> QAbstractEventDispatcher");

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

    {
        const  ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThread, &sipCpp))
        {
             ::QAbstractEventDispatcher*sipRes;

            sipRes = sipCpp->eventDispatcher();

            return sipConvertFromType(sipRes,sipType_QAbstractEventDispatcher,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_eventDispatcher, doc_QThread_eventDispatcher);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_setEventDispatcher, "setEventDispatcher(self, QAbstractEventDispatcher)");

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

    {
         ::QAbstractEventDispatcher* a0;
         ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ:", &sipSelf, sipType_QThread, &sipCpp, sipType_QAbstractEventDispatcher, &a0))
        {
            sipCpp->setEventDispatcher(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_setEventDispatcher, doc_QThread_setEventDispatcher);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_requestInterruption, "requestInterruption(self)");

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

    {
         ::QThread *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_requestInterruption, doc_QThread_requestInterruption);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_isInterruptionRequested, "isInterruptionRequested(self) -> bool");

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

    {
        const  ::QThread *sipCpp;

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

            sipRes = sipCpp->isInterruptionRequested();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_isInterruptionRequested, doc_QThread_isInterruptionRequested);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QThread_loopLevel, "loopLevel(self) -> int");

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

    {
        const  ::QThread *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QThread, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->loopLevel();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QThread, sipName_loopLevel, doc_QThread_loopLevel);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QThread)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

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


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


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


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

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


extern "C" {static void *init_type_QThread(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QThread(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **sipOwner, PyObject **sipParseErr)
{
    sipQThread *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 sipQThread(a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_QThread[] = {
    {sipName_currentThread, meth_QThread_currentThread, METH_VARARGS, doc_QThread_currentThread},
    {sipName_currentThreadId, meth_QThread_currentThreadId, METH_VARARGS, doc_QThread_currentThreadId},
    {sipName_event, meth_QThread_event, METH_VARARGS, doc_QThread_event},
    {sipName_eventDispatcher, meth_QThread_eventDispatcher, METH_VARARGS, doc_QThread_eventDispatcher},
    {sipName_exec, meth_QThread_exec, METH_VARARGS, doc_QThread_exec},
    {sipName_exec_, meth_QThread_exec_, METH_VARARGS, doc_QThread_exec_},
    {sipName_exit, SIP_MLMETH_CAST(meth_QThread_exit), METH_VARARGS|METH_KEYWORDS, doc_QThread_exit},
    {sipName_idealThreadCount, meth_QThread_idealThreadCount, METH_VARARGS, doc_QThread_idealThreadCount},
    {sipName_isFinished, meth_QThread_isFinished, METH_VARARGS, doc_QThread_isFinished},
    {sipName_isInterruptionRequested, meth_QThread_isInterruptionRequested, METH_VARARGS, doc_QThread_isInterruptionRequested},
    {sipName_isRunning, meth_QThread_isRunning, METH_VARARGS, doc_QThread_isRunning},
    {sipName_loopLevel, meth_QThread_loopLevel, METH_VARARGS, doc_QThread_loopLevel},
    {sipName_msleep, meth_QThread_msleep, METH_VARARGS, doc_QThread_msleep},
    {sipName_priority, meth_QThread_priority, METH_VARARGS, doc_QThread_priority},
    {sipName_quit, meth_QThread_quit, METH_VARARGS, doc_QThread_quit},
    {sipName_requestInterruption, meth_QThread_requestInterruption, METH_VARARGS, doc_QThread_requestInterruption},
    {sipName_run, meth_QThread_run, METH_VARARGS, doc_QThread_run},
    {sipName_setEventDispatcher, meth_QThread_setEventDispatcher, METH_VARARGS, doc_QThread_setEventDispatcher},
    {sipName_setPriority, meth_QThread_setPriority, METH_VARARGS, doc_QThread_setPriority},
    {sipName_setStackSize, meth_QThread_setStackSize, METH_VARARGS, doc_QThread_setStackSize},
    {sipName_setTerminationEnabled, SIP_MLMETH_CAST(meth_QThread_setTerminationEnabled), METH_VARARGS|METH_KEYWORDS, doc_QThread_setTerminationEnabled},
    {sipName_sleep, meth_QThread_sleep, METH_VARARGS, doc_QThread_sleep},
    {sipName_stackSize, meth_QThread_stackSize, METH_VARARGS, doc_QThread_stackSize},
    {sipName_start, SIP_MLMETH_CAST(meth_QThread_start), METH_VARARGS|METH_KEYWORDS, doc_QThread_start},
    {sipName_terminate, meth_QThread_terminate, METH_VARARGS, doc_QThread_terminate},
    {sipName_usleep, meth_QThread_usleep, METH_VARARGS, doc_QThread_usleep},
    {sipName_wait, SIP_MLMETH_CAST(meth_QThread_wait), METH_VARARGS|METH_KEYWORDS, doc_QThread_wait},
    {sipName_yieldCurrentThread, meth_QThread_yieldCurrentThread, METH_VARARGS, doc_QThread_yieldCurrentThread}
};

static sipEnumMemberDef enummembers_QThread[] = {
    {sipName_HighPriority, static_cast<int>( ::QThread::HighPriority), 295},
    {sipName_HighestPriority, static_cast<int>( ::QThread::HighestPriority), 295},
    {sipName_IdlePriority, static_cast<int>( ::QThread::IdlePriority), 295},
    {sipName_InheritPriority, static_cast<int>( ::QThread::InheritPriority), 295},
    {sipName_LowPriority, static_cast<int>( ::QThread::LowPriority), 295},
    {sipName_LowestPriority, static_cast<int>( ::QThread::LowestPriority), 295},
    {sipName_NormalPriority, static_cast<int>( ::QThread::NormalPriority), 295},
    {sipName_TimeCriticalPriority, static_cast<int>( ::QThread::TimeCriticalPriority), 295},
};

PyDoc_STRVAR(doc_QThread, "\1QThread(parent: QObject = None)");


/* Define this type's signals. */
static const pyqt5QtSignal signals_QThread[] = {
    {"finished()", "\1finished(self)", SIP_NULLPTR, SIP_NULLPTR},
    {"started()", "\1started(self)", SIP_NULLPTR, SIP_NULLPTR},
    {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR}
};


static pyqt5ClassPluginDef plugin_QThread = {
    & ::QThread::staticMetaObject,
    0,
    signals_QThread,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QThread = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QThread,
        SIP_NULLPTR,
        &plugin_QThread
    },
    {
        sipNameNr_QThread,
        {0, 0, 1},
        28, methods_QThread,
        8, enummembers_QThread,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QThread,
    -1,
    -1,
    supers_QThread,
    SIP_NULLPTR,
    init_type_QThread,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QThread,
    SIP_NULLPTR,
    array_QThread,
    SIP_NULLPTR,
    release_QThread,
    cast_QThread,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QThread,
    sizeof ( ::QThread),
};
