static int convertTo_QList_0100QWizard_WizardButton(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<QWizard::WizardButton> **sipCppPtr = reinterpret_cast<QList<QWizard::WizardButton> **>(sipCppPtrV);

#line 306 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/sip/QtGui/qwizard.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyList_Check(sipPy))
            return 0;

        for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
            if (!sipCanConvertToEnum(PyList_GET_ITEM(sipPy, i), sipType_QWizard_WizardButton))
                return 0;

        return 1;
    }

    QList<QWizard::WizardButton> *ql = new QList<QWizard::WizardButton>;
 
    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
    {
        long l = SIPLong_AsLong(PyList_GET_ITEM(sipPy, i));
        ql->append(static_cast<QWizard::WizardButton>(l));
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 103 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/QtGui/sipQtGuiQList0100QWizardWizardButton.cpp"
}
static int convertTo_QList_0100QAudioFormat_SampleType(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<QAudioFormat::SampleType> **sipCppPtr = reinterpret_cast<QList<QAudioFormat::SampleType> **>(sipCppPtrV);

#line 210 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/sip/QtMultimedia/qaudioformat.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyList_Check(sipPy))
            return 0;

        for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
            if (!sipCanConvertToEnum(PyList_GET_ITEM(sipPy, i), sipType_QAudioFormat_SampleType))
                return 0;

        return 1;
    }

    QList<QAudioFormat::SampleType> *ql = new QList<QAudioFormat::SampleType>;
 
    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
    {
        long l = SIPLong_AsLong(PyList_GET_ITEM(sipPy, i));
        ql->append(static_cast<QAudioFormat::SampleType>(l));
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 103 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/QtMultimedia/sipQtMultimediaQList0100QAudioFormatSampleType.cpp"
}
コード例 #3
0
static int convertTo_QList_0100QVariant_Type(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
     ::QList< ::QVariant::Type> **sipCppPtr = reinterpret_cast< ::QList< ::QVariant::Type> **>(sipCppPtrV);

#line 437 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/sip/QtCore/qvariant.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyList_Check(sipPy))
            return 0;

        for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
            if (!sipCanConvertToEnum(PyList_GET_ITEM(sipPy, i), sipType_QVariant_Type))
                return 0;

        return 1;
    }

    QList<QVariant::Type> *ql = new QList<QVariant::Type>;

    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
    {
        long l = SIPLong_AsLong(PyList_GET_ITEM(sipPy, i));
        ql->append(static_cast<QVariant::Type>(l));
    }

    *sipCppPtr = ql;

    return sipGetState(sipTransferObj);
#line 98 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/QtCore/sipQtCoreQList0100QVariantType.cpp"
}
コード例 #4
0
static int convertTo_QList_0100QVariant_Type(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<QVariant::Type> **sipCppPtr = reinterpret_cast<QList<QVariant::Type> **>(sipCppPtrV);

#line 444 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/sip/QtCore/qvariant.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyList_Check(sipPy))
            return 0;

        for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
            if (!sipCanConvertToEnum(PyList_GET_ITEM(sipPy, i), sipType_QVariant_Type))
                return 0;

        return 1;
    }

    QList<QVariant::Type> *ql = new QList<QVariant::Type>;

    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
    {
        long l = SIPLong_AsLong(PyList_GET_ITEM(sipPy, i));
        ql->append(static_cast<QVariant::Type>(l));
    }

    *sipCppPtr = ql;

    return sipGetState(sipTransferObj);
#line 98 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/QtCore/sipQtCoreQList0100QVariantType.cpp"
}
コード例 #5
0
static int convertTo_QUrl_FormattingOptions(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QUrl::FormattingOptions **sipCppPtr = reinterpret_cast<QUrl::FormattingOptions **>(sipCppPtrV);

#line 77 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/sip/QtCore/qurl.sip"
// Allow an instance of the base enums whenever a QUrl::FormattingOptions is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QUrl_UrlFormattingOption)) ||
            PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QUrl_ComponentFormattingOption)) ||
            sipCanConvertToType(sipPy, sipType_QUrl_FormattingOptions, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QUrl_UrlFormattingOption)) ||
     PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QUrl_ComponentFormattingOption)))
{
    *sipCppPtr = new QUrl::FormattingOptions(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QUrl::FormattingOptions *>(sipConvertToType(sipPy, sipType_QUrl_FormattingOptions, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 459 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/QtCore/sipQtCoreQUrlFormattingOptions.cpp"
}
コード例 #6
0
static int convertTo_QEasingCurve(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QEasingCurve **sipCppPtr = reinterpret_cast<QEasingCurve **>(sipCppPtrV);

#line 139 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtCore/qeasingcurve.sip"
// Allow a QEasingCurve::Type whenever a QEasingCurve is expected.

if (sipIsErr == NULL)
{
    if (sipCanConvertToType(sipPy, sipType_QEasingCurve, SIP_NO_CONVERTORS))
        return 1;

    if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QEasingCurve_Type)))
        return 1;

    return 0;
}

if (sipCanConvertToType(sipPy, sipType_QEasingCurve, SIP_NO_CONVERTORS))
{
    *sipCppPtr = reinterpret_cast<QEasingCurve *>(sipConvertToType(sipPy, sipType_QEasingCurve, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

    return 0;
}

*sipCppPtr = new QEasingCurve((QEasingCurve::Type)SIPLong_AsLong(sipPy));

return sipGetState(sipTransferObj);
#line 803 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtCore/sipQtCoreQEasingCurve.cpp"
}
コード例 #7
0
static int convertTo_QPair_1800_1800(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QPair<int,int> **sipCppPtr = reinterpret_cast<QPair<int,int> **>(sipCppPtrV);

#line 36 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/sip/QtCore/qpair.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
        return (PyTuple_Size(sipPy) == 2);

    QPair<int, int> *qp = new QPair<int, int>;
 
    qp->first = SIPLong_AsLong(PyTuple_GET_ITEM(sipPy, 0));
    qp->second = SIPLong_AsLong(PyTuple_GET_ITEM(sipPy, 1));

    *sipCppPtr = qp;
 
    return sipGetState(sipTransferObj);
#line 83 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/QtCore/sipQtCoreQPair18001800.cpp"
}
static int convertTo_QSet_0100Qt_DayOfWeek(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QSet<Qt::DayOfWeek> **sipCppPtr = reinterpret_cast<QSet<Qt::DayOfWeek> **>(sipCppPtrV);

#line 2157 "/Users/ktaylora/PLJV/tillage_likelihood_model/gui/PyQt4/sip/QtCore/qnamespace.sip"
    PyObject *it = PyObject_GetIter(sipPy), *itm;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (it == NULL)
            return 0;

        while ((itm = PyIter_Next(it)) != NULL)
        {
            int ok = sipCanConvertToEnum(itm, sipType_Qt_DayOfWeek);

            Py_DECREF(itm);

            if (!ok)
            {
                Py_DECREF(it);
                return 0;
            }
        }

        Py_DECREF(it);
        return 1;
    }

    if (it == NULL)
    {
        *sipIsErr = 1;
        return 0;
    }

    QSet<Qt::DayOfWeek> *qs = new QSet<Qt::DayOfWeek>;

    while ((itm = PyIter_Next(it)) != NULL)
    {
        long l = SIPLong_AsLong(itm);

        Py_DECREF(itm);

        qs->insert(static_cast<Qt::DayOfWeek>(l));
    }

    Py_DECREF(it);

    *sipCppPtr = qs;

    return sipGetState(sipTransferObj);
#line 127 "/Users/ktaylora/PLJV/tillage_likelihood_model/gui/PyQt4/QtCore/sipQtCoreQSet0100QtDayOfWeek.cpp"
}
コード例 #9
0
static int varset_QStyleOptionGroupBox_midLineWidth(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
    QStyleOptionGroupBox *sipCpp = reinterpret_cast<QStyleOptionGroupBox *>(sipSelf);

    sipVal = (int)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->midLineWidth = sipVal;

    return 0;
}
コード例 #10
0
static int varset_QStyleOptionHeader_selectedPosition(void *sipSelf, PyObject *sipPy, PyObject *)
{
    QStyleOptionHeader::SelectedPosition sipVal;
    QStyleOptionHeader *sipCpp = reinterpret_cast<QStyleOptionHeader *>(sipSelf);

    sipVal = (QStyleOptionHeader::SelectedPosition)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->selectedPosition = sipVal;

    return 0;
}
コード例 #11
0
static int varset_QAbstractEventDispatcher_TimerInfo_timerType(void *sipSelf, PyObject *sipPy, PyObject *)
{
    Qt::TimerType sipVal;
    QAbstractEventDispatcher::TimerInfo *sipCpp = reinterpret_cast<QAbstractEventDispatcher::TimerInfo *>(sipSelf);

    sipVal = (Qt::TimerType)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->timerType = sipVal;

    return 0;
}
コード例 #12
0
static int varset_Defect_q(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
    Defect *sipCpp = reinterpret_cast<Defect *>(sipSelf);

    sipVal = (int)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->q = sipVal;

    return 0;
}
コード例 #13
0
static int varset_QStyleOptionHeader_sortIndicator(void *sipSelf, PyObject *sipPy, PyObject *)
{
    QStyleOptionHeader::SortIndicator sipVal;
    QStyleOptionHeader *sipCpp = reinterpret_cast<QStyleOptionHeader *>(sipSelf);

    sipVal = (QStyleOptionHeader::SortIndicator)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->sortIndicator = sipVal;

    return 0;
}
コード例 #14
0
static int varset_QQuickItem_ItemChangeData_boolValue(void *sipSelf, PyObject *sipPy, PyObject *)
{
    bool sipVal;
    QQuickItem::ItemChangeData *sipCpp = reinterpret_cast<QQuickItem::ItemChangeData *>(sipSelf);

    sipVal = (bool)SIPLong_AsLong(sipPy);

    if (PyErr_Occurred() != NULL)
        return -1;

    sipCpp->boolValue = sipVal;

    return 0;
}
コード例 #15
0
ファイル: voidptr.c プロジェクト: Werkov/SIP
/*
 * Implement setwriteable() for the type.
 */
static PyObject *sipVoidPtr_setwriteable(sipVoidPtrObject *v, PyObject *arg)
{
    int rw;

    rw = (int)SIPLong_AsLong(arg);

    if (PyErr_Occurred())
        return NULL;

    v->rw = rw;

    Py_INCREF(Py_None);
    return Py_None;
}
コード例 #16
0
static int convertTo_QHash_1800_0100QByteArray(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QHash<int, ::QByteArray> **sipCppPtr = reinterpret_cast<QHash<int, ::QByteArray> **>(sipCppPtrV);

#line 190 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/sip/QtCore/qhash.sip"
    PyObject *kobj, *tobj;
    SIP_SSIZE_T i = 0;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyDict_Check(sipPy))
            return 0;

        while (PyDict_Next(sipPy, &i, &kobj, &tobj))
            if (!sipCanConvertToType(tobj, sipType_QByteArray, SIP_NOT_NONE))
                return 0;

        return 1;
    }

    QHash<int, QByteArray> *qm = new QHash<int, QByteArray>;
 
    while (PyDict_Next(sipPy, &i, &kobj, &tobj))
    {
        int state, k = SIPLong_AsLong(kobj);
        QByteArray *t = reinterpret_cast<QByteArray *>(sipConvertToType(tobj, sipType_QByteArray, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_QByteArray, state);

            delete qm;
            return 0;
        }

        qm->insert(k, *t);

        sipReleaseType(t, sipType_QByteArray, state);
    }
 
    *sipCppPtr = qm;
 
    return sipGetState(sipTransferObj);
#line 113 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/QtCore/sipQtCoreQHash18000100QByteArray.cpp"
}
コード例 #17
0
static int convertTo_QMap_1800_0100QVariant(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QMap<int,QVariant> **sipCppPtr = reinterpret_cast<QMap<int,QVariant> **>(sipCppPtrV);

#line 200 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qmap.sip"
    PyObject *kobj, *tobj;
    SIP_SSIZE_T i = 0;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyDict_Check(sipPy))
            return 0;

        while (PyDict_Next(sipPy, &i, &kobj, &tobj))
            if (!sipCanConvertToType(tobj, sipType_QVariant, SIP_NOT_NONE))
                return 0;

        return 1;
    }

    QMap<int, QVariant> *qm = new QMap<int, QVariant>;
 
    while (PyDict_Next(sipPy, &i, &kobj, &tobj))
    {
        int state, k = SIPLong_AsLong(kobj);
        QVariant *t = reinterpret_cast<QVariant *>(sipConvertToType(tobj, sipType_QVariant, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_QVariant, state);

            delete qm;
            return 0;
        }

        qm->insert(k, *t);

        sipReleaseType(t, sipType_QVariant, state);
    }
 
    *sipCppPtr = qm;
 
    return sipGetState(sipTransferObj);
#line 126 "sipQtCoreQMap18000100QVariant.cpp"
}
コード例 #18
0
static int convertTo_QVector_1800(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QVector<int> **sipCppPtr = reinterpret_cast<QVector<int> **>(sipCppPtrV);

#line 132 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/sip/QtCore/qvector.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
        return PyList_Check(sipPy);

    QVector<int> *qv = new QVector<int>;
 
    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
        qv->append(SIPLong_AsLong(PyList_GET_ITEM(sipPy, i)));
 
    *sipCppPtr = qv;
 
    return sipGetState(sipTransferObj);
#line 83 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/QtCore/sipQtCoreQVector1800.cpp"
}
コード例 #19
0
ファイル: sipQtCoreQVector1800.cpp プロジェクト: thaisdb/TCC
static int convertTo_QVector_1800(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
     ::QVector<int> **sipCppPtr = reinterpret_cast< ::QVector<int> **>(sipCppPtrV);

#line 132 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/sip/QtCore/qvector.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
        return PyList_Check(sipPy);

    QVector<int> *qv = new QVector<int>;
 
    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
        qv->append(SIPLong_AsLong(PyList_GET_ITEM(sipPy, i)));
 
    *sipCppPtr = qv;
 
    return sipGetState(sipTransferObj);
#line 83 "/home/thais/Faculdade/TCC/NEW/PyQt4_gpl_x11-4.12/QtCore/sipQtCoreQVector1800.cpp"
}
コード例 #20
0
ファイル: sipQtCoreQList1800.cpp プロジェクト: annelida/stuff
static int convertTo_QList_1800(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<int> **sipCppPtr = reinterpret_cast<QList<int> **>(sipCppPtrV);

#line 652 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/sip/QtCore/qlist.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
        return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >= 0);

    QList<int> *ql = new QList<int>;
    SIP_SSIZE_T len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);

        PyErr_Clear();
        long val = itm ? SIPLong_AsLong(itm) : -1;
        
        if (!itm || (val == -1 && PyErr_Occurred()))
        {
            Py_XDECREF(itm);
            delete ql;
            *sipIsErr = 1;

            return 0;
        }

        ql->append(val);

        Py_DECREF(itm);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 102 "/home/vikky/Desktop/DVCS/stuff/scrapy/soft/PyQt-x11-gpl-4.11.4/QtCore/sipQtCoreQList1800.cpp"
}
コード例 #21
0
static int convertTo_QList_1800(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<int> **sipCppPtr = reinterpret_cast<QList<int> **>(sipCppPtrV);

#line 657 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/sip/QtCore/qlist.sip"
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
        return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >= 0);

    QList<int> *ql = new QList<int>;
    SIP_SSIZE_T len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);

        PyErr_Clear();
        long val = itm ? SIPLong_AsLong(itm) : -1;
        
        if (!itm || (val == -1 && PyErr_Occurred()))
        {
            Py_XDECREF(itm);
            delete ql;
            *sipIsErr = 1;

            return 0;
        }

        ql->append(val);

        Py_DECREF(itm);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 107 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/QtCore/sipQtCoreQList1800.cpp"
}
コード例 #22
0
static int convertTo_QTextEdit_AutoFormatting(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QTextEdit::AutoFormatting **sipCppPtr = reinterpret_cast<QTextEdit::AutoFormatting **>(sipCppPtrV);

#line 124 "sip/QtCore/qglobal.sip"
// Allow an instance of the base enum whenever a QTextEdit::AutoFormatting is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QTextEdit_AutoFormattingFlag)) ||
            sipCanConvertToType(sipPy, sipType_QTextEdit_AutoFormatting, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QTextEdit_AutoFormattingFlag)))
{
    *sipCppPtr = new QTextEdit::AutoFormatting(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QTextEdit::AutoFormatting *>(sipConvertToType(sipPy, sipType_QTextEdit_AutoFormatting, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 547 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtWidgets/sipQtWidgetsQTextEditAutoFormatting.cpp"
}
コード例 #23
0
static int convertTo_QIODevice_OpenMode(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QIODevice::OpenMode **sipCppPtr = reinterpret_cast<QIODevice::OpenMode **>(sipCppPtrV);

#line 124 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtCore/qglobal.sip"
// Allow an instance of the base enum whenever a QIODevice::OpenMode is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QIODevice_OpenModeFlag)) ||
            sipCanConvertToType(sipPy, sipType_QIODevice_OpenMode, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QIODevice_OpenModeFlag)))
{
    *sipCppPtr = new QIODevice::OpenMode(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QIODevice::OpenMode *>(sipConvertToType(sipPy, sipType_QIODevice_OpenMode, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 547 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtCore/sipQtCoreQIODeviceOpenMode.cpp"
}
static int convertTo_QWebEnginePage_FindFlags(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QWebEnginePage::FindFlags **sipCppPtr = reinterpret_cast<QWebEnginePage::FindFlags **>(sipCppPtrV);

#line 124 "sip/QtCore/qglobal.sip"
// Allow an instance of the base enum whenever a QWebEnginePage::FindFlags is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QWebEnginePage_FindFlag)) ||
            sipCanConvertToType(sipPy, sipType_QWebEnginePage_FindFlags, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QWebEnginePage_FindFlag)))
{
    *sipCppPtr = new QWebEnginePage::FindFlags(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QWebEnginePage::FindFlags *>(sipConvertToType(sipPy, sipType_QWebEnginePage_FindFlags, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 547 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtWebEngineWidgets/sipQtWebEngineWidgetsQWebEnginePageFindFlags.cpp"
}
コード例 #25
0
static int convertTo_QNetworkSession_UsagePolicies(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QNetworkSession::UsagePolicies **sipCppPtr = reinterpret_cast<QNetworkSession::UsagePolicies **>(sipCppPtrV);

#line 124 "sip/QtCore/qglobal.sip"
// Allow an instance of the base enum whenever a QNetworkSession::UsagePolicies is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QNetworkSession_UsagePolicy)) ||
            sipCanConvertToType(sipPy, sipType_QNetworkSession_UsagePolicies, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QNetworkSession_UsagePolicy)))
{
    *sipCppPtr = new QNetworkSession::UsagePolicies(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QNetworkSession::UsagePolicies *>(sipConvertToType(sipPy, sipType_QNetworkSession_UsagePolicies, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 547 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtNetwork/sipQtNetworkQNetworkSessionUsagePolicies.cpp"
}
コード例 #26
0
static int convertTo_QSGEngine_CreateTextureOptions(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QSGEngine::CreateTextureOptions **sipCppPtr = reinterpret_cast<QSGEngine::CreateTextureOptions **>(sipCppPtrV);

#line 124 "sip/QtCore/qglobal.sip"
// Allow an instance of the base enum whenever a QSGEngine::CreateTextureOptions is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QSGEngine_CreateTextureOption)) ||
            sipCanConvertToType(sipPy, sipType_QSGEngine_CreateTextureOptions, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QSGEngine_CreateTextureOption)))
{
    *sipCppPtr = new QSGEngine::CreateTextureOptions(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QSGEngine::CreateTextureOptions *>(sipConvertToType(sipPy, sipType_QSGEngine_CreateTextureOptions, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 547 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtQuick/sipQtQuickQSGEngineCreateTextureOptions.cpp"
}
コード例 #27
0
static int convertTo_QHostAddress(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QHostAddress **sipCppPtr = reinterpret_cast<QHostAddress **>(sipCppPtrV);

#line 34 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtNetwork/qhostaddress.sip"
// SIP doesn't support automatic type convertors so we explicitly allow a
// QHostAddress::SpecialAddress to be used whenever a QHostAddress is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QHostAddress_SpecialAddress)) ||
            sipCanConvertToType(sipPy, sipType_QHostAddress, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_QHostAddress_SpecialAddress)))
{
    *sipCppPtr = new QHostAddress((QHostAddress::SpecialAddress)SIPLong_AsLong(sipPy));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<QHostAddress *>(sipConvertToType(sipPy, sipType_QHostAddress, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
#line 697 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtNetwork/sipQtNetworkQHostAddress.cpp"
}
コード例 #28
0
// Convert a Python object to a GLint.
static void convert_int(PyObject *itm, void *array, Py_ssize_t i)
{
    reinterpret_cast<GLint *>(array)[i] = SIPLong_AsLong(itm);
}
コード例 #29
0
// Connect a signal.
static PyObject *pyqtBoundSignal_connect(PyObject *self, PyObject *args,
        PyObject *kwd_args)
{
    qpycore_pyqtBoundSignal *bs = (qpycore_pyqtBoundSignal *)self;

    static const char *kwds[] = {
        "slot",
        "type",
        0
    };

    PyObject *py_slot, *py_type = 0;

    if (!PyArg_ParseTupleAndKeywords(args, kwd_args, "O|O:connect",
                const_cast<char **>(kwds), &py_slot, &py_type))
        return 0;

    Qt::ConnectionType q_type = Qt::AutoConnection;

    if (py_type)
    {
        if (!sipCanConvertToEnum(py_type, sipType_Qt_ConnectionType))
        {
            PyErr_Format(PyExc_TypeError,
                    "Qt.ConnectionType expected, not '%s'",
                    Py_TYPE(py_slot)->tp_name);

            return 0;
        }

        q_type = (Qt::ConnectionType)SIPLong_AsLong(py_type);
    }

    QObject *q_tx = bs->bound_qobject, *q_rx;
    Chimera::Signature *signal_signature = bs->unbound_signal->signature;
    QByteArray slot_signature;

    sipErrorState estate = qpycore_get_receiver_slot_signature(py_slot, q_tx,
            signal_signature, false, &q_rx, slot_signature);

    if (estate != sipErrorNone)
    {
        if (estate == sipErrorContinue)
            sipBadCallableArg(0, py_slot);

        return 0;
    }

    // Connect the signal to the slot and handle any errors.

    bool ok;

    Py_BEGIN_ALLOW_THREADS
    ok = QObject::connect(q_tx, signal_signature->signature.constData(), q_rx,
            slot_signature.constData(), q_type);
    Py_END_ALLOW_THREADS

    if (!ok)
    {
        QByteArray slot_name = Chimera::Signature::name(slot_signature);

        PyErr_Format(PyExc_TypeError, "connect() failed between %s and %s()",
                signal_signature->py_signature.constData(),
                slot_name.constData() + 1);

        return 0;
    }

    Py_INCREF(Py_None);
    return Py_None;
}
コード例 #30
0
static int convertTo_QList_0100Qt_DayOfWeek(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Qt::DayOfWeek> **sipCppPtr = reinterpret_cast<QList<Qt::DayOfWeek> **>(sipCppPtrV);

#line 861 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtCore/qpycore_qlist.sip"
    PyObject *iter = PyObject_GetIter(sipPy);

    if (!sipIsErr)
    {
        Py_XDECREF(iter);

        return (iter
#if PY_MAJOR_VERSION < 3
                && !PyString_Check(sipPy)
#endif
                && !PyUnicode_Check(sipPy));
    }

    if (!iter)
    {
        *sipIsErr = 1;

        return 0;
    }

    QList<Qt::DayOfWeek> *ql = new QList<Qt::DayOfWeek>;

    for (SIP_SSIZE_T i = 0; ; ++i)
    {
        PyErr_Clear();
        PyObject *itm = PyIter_Next(iter);

        if (!itm)
        {
            if (PyErr_Occurred())
            {
                delete ql;
                Py_DECREF(iter);
                *sipIsErr = 1;

                return 0;
            }

            break;
        }

        if (!sipCanConvertToEnum(itm, sipType_Qt_DayOfWeek))
        {
            PyErr_Format(PyExc_TypeError,
                    "index " SIP_SSIZE_T_FORMAT " has type '%s' but 'Qt.DayOfWeek' is expected",
                    i, Py_TYPE(itm)->tp_name);

            Py_DECREF(itm);
            delete ql;
            Py_DECREF(iter);
            *sipIsErr = 1;

            return 0;
        }

        ql->append(static_cast<Qt::DayOfWeek>(SIPLong_AsLong(itm)));

        Py_DECREF(itm);
    }

    Py_DECREF(iter);

    *sipCppPtr = ql;

    return sipGetState(sipTransferObj);
#line 137 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtCore/sipQtCoreQList0100QtDayOfWeek.cpp"
}