/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.3
 *
 * Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 "sipAPIQtTest.h"

#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
#include <qsignalspy.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"

#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qobject.sip"
#include <qobject.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"
#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 39 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 42 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"
#line 30 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 45 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"


PyDoc_STRVAR(doc_QSignalSpy_isValid, "isValid(self) -> bool");

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

    {
        const ::QSignalSpy *sipCpp;

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

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName_isValid, doc_QSignalSpy_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSignalSpy_signal, "signal(self) -> QByteArray");

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

    {
        const ::QSignalSpy *sipCpp;

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

            sipRes = new ::QByteArray(sipCpp->signal());

            return sipConvertFromNewType(sipRes, sipType_QByteArray, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName_signal, doc_QSignalSpy_signal);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSignalSpy_wait, "wait(self, timeout: int = 5000) -> bool");

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

    {
        int a0 = 5000;
        ::QSignalSpy *sipCpp;

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

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

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

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName_wait, doc_QSignalSpy_wait);

    return SIP_NULLPTR;
}


extern "C" {static int slot_QSignalSpy___delitem__(PyObject *, PyObject *);}
static int slot_QSignalSpy___delitem__(PyObject *sipSelf, PyObject *sipArg)
{
    ::QSignalSpy *sipCpp = reinterpret_cast< ::QSignalSpy *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QSignalSpy));

    if (!sipCpp)
        return -1;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
            int sipIsErr = 0;

#line 75 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
        if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
            sipIsErr = 1;
        else
            sipCpp->removeAt(a0);
#line 155 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"

            if (sipIsErr)
                return -1;

            return 0;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName___delitem__, SIP_NULLPTR);

    return -1;
}


extern "C" {static int slot_QSignalSpy___setitem__(PyObject *, PyObject *);}
static int slot_QSignalSpy___setitem__(PyObject *sipSelf, PyObject *sipArgs)
{
    ::QSignalSpy *sipCpp = reinterpret_cast< ::QSignalSpy *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QSignalSpy));

    if (!sipCpp)
        return -1;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;
        const QList< ::QVariant>* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "iJ1", &a0, sipType_QList_0100QVariant, &a1, &a1State))
        {
            int sipIsErr = 0;

#line 65 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
        int len = sipCpp->count();
        
        if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
            sipIsErr = 1;
        else
            (*sipCpp)[a0] = *a1;
#line 196 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"
            sipReleaseType(const_cast<QList< ::QVariant> *>(a1), sipType_QList_0100QVariant, a1State);

            if (sipIsErr)
                return -1;

            return 0;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName___setitem__, SIP_NULLPTR);

    return -1;
}


extern "C" {static PyObject *slot_QSignalSpy___getitem__(PyObject *, PyObject *);}
static PyObject *slot_QSignalSpy___getitem__(PyObject *sipSelf, PyObject *sipArg)
{
    ::QSignalSpy *sipCpp = reinterpret_cast< ::QSignalSpy *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QSignalSpy));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
            QList< ::QVariant>*sipRes = 0;
            int sipIsErr = 0;

#line 55 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
        Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
        
        if (idx < 0)
            sipIsErr = 1;
        else
            sipRes = new QList<QVariant>(sipCpp->at((int)idx));
#line 237 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"

            if (sipIsErr)
                return 0;

            return sipConvertFromNewType(sipRes, sipType_QList_0100QVariant, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSignalSpy, sipName___getitem__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static Py_ssize_t slot_QSignalSpy___len__(PyObject *);}
static Py_ssize_t slot_QSignalSpy___len__(PyObject *sipSelf)
{
    ::QSignalSpy *sipCpp = reinterpret_cast< ::QSignalSpy *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QSignalSpy));

    if (!sipCpp)
        return 0;


    {
        {
            Py_ssize_t sipRes = 0;

#line 50 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
        sipRes = sipCpp->count();
#line 267 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"

            return sipRes;
        }
    }

    return 0;
}


/* Call the instance's destructor. */
extern "C" {static void release_QSignalSpy(void *, int);}
static void release_QSignalSpy(void *sipCppV, int)
{
    delete reinterpret_cast< ::QSignalSpy *>(sipCppV);
}


extern "C" {static void dealloc_QSignalSpy(sipSimpleWrapper *);}
static void dealloc_QSignalSpy(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QSignalSpy(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QSignalSpy(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QSignalSpy(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::QSignalSpy *sipCpp = SIP_NULLPTR;

    {
        PyObject * a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "P0", &a0))
        {
            sipErrorState sipError = sipErrorNone;

#line 34 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtTest/qsignalspy.sip"
        QObject *sender;
        QByteArray signal_signature;
        
        if ((sipError = pyqt6_qttest_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
            sipCpp = new QSignalSpy(sender, signal_signature.constData());
        else if (sipError == sipErrorContinue)
            sipError = sipBadCallableArg(0, a0);
#line 315 "/build/pyqt6/src/pyqt6-6.11.0/build/QtTest/sipQtTestQSignalSpy.cpp"

            if (sipError == sipErrorNone)
                return sipCpp;

            if (sipUnused)
            {
                Py_XDECREF(*sipUnused);
            }

            sipAddException(sipError, sipParseErr);

            if (sipError == sipErrorFail)
                return SIP_NULLPTR;
        }
    }

    {
        const ::QObject* a0;
        ::QMetaMethod* a1;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J8J9", sipType_QObject, &a0, sipType_QMetaMethod, &a1))
        {
            sipCpp = new ::QSignalSpy(a0, *a1);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QSignalSpy[] = {
    {(void *)slot_QSignalSpy___delitem__, delitem_slot},
    {(void *)slot_QSignalSpy___setitem__, setitem_slot},
    {(void *)slot_QSignalSpy___getitem__, getitem_slot},
    {(void *)slot_QSignalSpy___len__, len_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QSignalSpy[] = {
    {sipName_isValid, meth_QSignalSpy_isValid, METH_VARARGS, doc_QSignalSpy_isValid},
    {sipName_signal, meth_QSignalSpy_signal, METH_VARARGS, doc_QSignalSpy_signal},
    {sipName_wait, SIP_MLMETH_CAST(meth_QSignalSpy_wait), METH_VARARGS|METH_KEYWORDS, doc_QSignalSpy_wait}
};

PyDoc_STRVAR(doc_QSignalSpy, "\1QSignalSpy(signal: QtCore.pyqtBoundSignal)\n"
"QSignalSpy(obj: QObject|None, signal: QMetaMethod)");


sipClassTypeDef sipTypeDef_QtTest_QSignalSpy = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSignalSpy,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QSignalSpy,
        {0, 0, 1},
        3, methods_QSignalSpy,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QSignalSpy,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QSignalSpy,
    init_type_QSignalSpy,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSignalSpy,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QSignalSpy,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QSignalSpy),
};
