/*
 * 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 "sipAPIQtCore.h"

#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"

#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmetatype.sip"
#include <qmetatype.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qdatastream.sip"
#include <qdatastream.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"


PyDoc_STRVAR(doc_QVariant_value, "value(self) -> Any");

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

    {
        const ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QVariant, &sipCpp))
        {
            PyObject * sipRes = SIP_NULLPTR;

#line 74 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
        sipRes = qpycore_PyObject_FromQVariant(*sipCpp);
#line 55 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_value, doc_QVariant_value);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_userType, "userType(self) -> int");

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

    {
        const ::QVariant *sipCpp;

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

            sipRes = sipCpp->userType();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_userType, doc_QVariant_userType);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_typeName, "typeName(self) -> str");

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

    {
        const ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QVariant, &sipCpp))
        {
            const char*sipRes;

            sipRes = sipCpp->typeName();

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_typeName, doc_QVariant_typeName);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_canConvert, "canConvert(self, targetType: QMetaType) -> bool");

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

    {
        ::QMetaType* a0;
        const ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QMetaType, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->canConvert(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_canConvert, doc_QVariant_canConvert);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_convert, "convert(self, type: QMetaType) -> bool");

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

    {
        ::QMetaType* a0;
        ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QMetaType, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->convert(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_convert, doc_QVariant_convert);

    return SIP_NULLPTR;
}


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

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

    {
        const ::QVariant *sipCpp;

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

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_isValid, doc_QVariant_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_isNull, "isNull(self) -> bool");

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

    {
        const ::QVariant *sipCpp;

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

            sipRes = sipCpp->isNull();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_isNull, doc_QVariant_isNull);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_clear, "clear(self)");

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

    {
        ::QVariant *sipCpp;

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

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_clear, doc_QVariant_clear);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_load, "load(self, ds: QDataStream)");

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

    {
        ::QDataStream* a0;
        ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QDataStream, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->load(*a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_load, doc_QVariant_load);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_save, "save(self, ds: QDataStream)");

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

    {
        ::QDataStream* a0;
        const ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QDataStream, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->save(*a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_save, doc_QVariant_save);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_swap, "swap(self, other: QVariant|None)");

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

    {
        ::QVariant* a0;
        ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QVariant, &a0))
        {
            sipCpp->swap(*a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_swap, doc_QVariant_swap);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_metaType, "metaType(self) -> QMetaType");

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

    {
        const ::QVariant *sipCpp;

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

            sipRes = reinterpret_cast< ::QMetaType *>(::operator new(sizeof (::QMetaType)));
            *sipRes = sipCpp->metaType();

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

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_metaType, doc_QVariant_metaType);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_canView, "canView(self, targetType: QMetaType) -> bool");

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

    {
        ::QMetaType* a0;
        const ::QVariant *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QVariant, &sipCpp, sipType_QMetaType, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->canView(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_canView, doc_QVariant_canView);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QVariant_typeId, "typeId(self) -> int");

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

    {
        const ::QVariant *sipCpp;

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

            sipRes = sipCpp->typeId();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QVariant, sipName_typeId, doc_QVariant_typeId);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QVariant___eq__(PyObject *, PyObject *);}
static PyObject *slot_QVariant___eq__(PyObject *sipSelf, PyObject *sipArg)
{
    ::QVariant *sipCpp = reinterpret_cast< ::QVariant *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QVariant));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QVariant* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J1", sipType_QVariant, &a0, &a0State))
        {
            bool sipRes;

            sipRes = operator==((*sipCpp), *a0);
            sipReleaseType(const_cast< ::QVariant *>(a0), sipType_QVariant, a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    return sipPySlotExtend(&sipModuleAPI_QtCore, eq_slot, sipType_QVariant, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QVariant___ne__(PyObject *, PyObject *);}
static PyObject *slot_QVariant___ne__(PyObject *sipSelf, PyObject *sipArg)
{
    ::QVariant *sipCpp = reinterpret_cast< ::QVariant *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QVariant));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QVariant* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J1", sipType_QVariant, &a0, &a0State))
        {
            bool sipRes;

            sipRes = operator!=((*sipCpp), *a0);
            sipReleaseType(const_cast< ::QVariant *>(a0), sipType_QVariant, a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    return sipPySlotExtend(&sipModuleAPI_QtCore, ne_slot, sipType_QVariant, sipSelf, sipArg);
}


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


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


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


extern "C" {static void assign_QVariant(void *, Py_ssize_t, void *);}
static void assign_QVariant(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QVariant *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QVariant *>(sipSrc);
}


extern "C" {static void *copy_QVariant(const void *, Py_ssize_t);}
static void *copy_QVariant(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::QVariant(reinterpret_cast<const ::QVariant *>(sipSrc)[sipSrcIdx]);
}


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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new ::QVariant();

            return sipCpp;
        }
    }

    {
        PyObject * a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "P0", &a0))
        {
#line 62 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
        int is_err = 0;
        QVariant var = qpycore_PyObject_AsQVariant(a0, &is_err);
        
        if (is_err)
            sipCpp = 0;
        else
            sipCpp = new QVariant(var);
#line 553 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"

            return sipCpp;
        }
    }

    {
        const ::QVariant* a0;
        int a0State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J1", sipType_QVariant, &a0, &a0State))
        {
            sipCpp = new ::QVariant(*a0);
            sipReleaseType(const_cast< ::QVariant *>(a0), sipType_QVariant, a0State);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


extern "C" {static int convertTo_QVariant(PyObject *, void **, int *, PyObject *, void **);}
static int convertTo_QVariant(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj, void **)
{
    ::QVariant **sipCppPtr = reinterpret_cast< ::QVariant **>(sipCppPtrV);

#line 30 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
if (sipIsErr == NULL)
    // We can convert everything to a QVariant.
    return 1;

// If it is already a QVariant then just return it.
if (Py_TYPE(sipPy) == sipTypeAsPyTypeObject(sipType_QVariant))
{
    *sipCppPtr = reinterpret_cast<QVariant *>(sipConvertToType(sipPy,
            sipType_QVariant, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

    return 0;
}

// Convert it to a QVariant.
QVariant var = qpycore_PyObject_AsQVariant(sipPy, sipIsErr);

if (*sipIsErr)
    return 0;

*sipCppPtr = new QVariant(var);

return sipGetState(sipTransferObj);
#line 604 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"
}


extern "C" {static PyObject *convertFrom_QVariant(void *, PyObject *);}
static PyObject *convertFrom_QVariant(void *sipCppV, PyObject *)
{
    ::QVariant *sipCpp = reinterpret_cast< ::QVariant *>(sipCppV);

#line 55 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qvariant.sip"
return qpycore_PyObject_FromQVariant(*sipCpp);
#line 615 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQVariant.cpp"
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QVariant[] = {
    {(void *)slot_QVariant___eq__, eq_slot},
    {(void *)slot_QVariant___ne__, ne_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QVariant[] = {
    {sipName_canConvert, meth_QVariant_canConvert, METH_VARARGS, doc_QVariant_canConvert},
    {sipName_canView, meth_QVariant_canView, METH_VARARGS, doc_QVariant_canView},
    {sipName_clear, meth_QVariant_clear, METH_VARARGS, doc_QVariant_clear},
    {sipName_convert, meth_QVariant_convert, METH_VARARGS, doc_QVariant_convert},
    {sipName_isNull, meth_QVariant_isNull, METH_VARARGS, doc_QVariant_isNull},
    {sipName_isValid, meth_QVariant_isValid, METH_VARARGS, doc_QVariant_isValid},
    {sipName_load, meth_QVariant_load, METH_VARARGS, doc_QVariant_load},
    {sipName_metaType, meth_QVariant_metaType, METH_VARARGS, doc_QVariant_metaType},
    {sipName_save, meth_QVariant_save, METH_VARARGS, doc_QVariant_save},
    {sipName_swap, meth_QVariant_swap, METH_VARARGS, doc_QVariant_swap},
    {sipName_typeId, meth_QVariant_typeId, METH_VARARGS, doc_QVariant_typeId},
    {sipName_typeName, meth_QVariant_typeName, METH_VARARGS, doc_QVariant_typeName},
    {sipName_userType, meth_QVariant_userType, METH_VARARGS, doc_QVariant_userType},
    {sipName_value, meth_QVariant_value, METH_VARARGS, doc_QVariant_value}
};

PyDoc_STRVAR(doc_QVariant, "\1QVariant()\n"
"QVariant(obj: Any)\n"
"QVariant(a0: QVariant|None)");


sipClassTypeDef sipTypeDef_QtCore_QVariant = {
    {
        SIP_NULLPTR,
        SIP_TYPE_ALLOW_NONE|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QVariant,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QVariant,
        {0, 0, 1},
        14, methods_QVariant,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QVariant,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QVariant,
    init_type_QVariant,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QVariant,
    assign_QVariant,
    array_QVariant,
    copy_QVariant,
    release_QVariant,
    SIP_NULLPTR,
    convertTo_QVariant,
    convertFrom_QVariant,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QVariant,
    sizeof (::QVariant),
};
