Пример #1
0
static int slot_QPolygonF___contains__(PyObject *sipSelf,PyObject *sipArg)
{
    QPolygonF *sipCpp = reinterpret_cast<QPolygonF *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPolygonF));

    if (!sipCpp)
        return -1;

    PyObject *sipParseErr = NULL;

    {
        const QPointF* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J1", sipType_QPointF, &a0, &a0State))
        {
            int sipRes = 0;

#line 515 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\sip/QtGui/qpolygon.sip"
// It looks like you can't assign QBool to int.
sipRes = bool(sipCpp->contains(*a0));
#line 1023 "C:\\Users\\marcus\\Downloads\\PyQt-gpl-5.4\\PyQt-gpl-5.4\\QtGui/sipQtGuiQPolygonF.cpp"
            sipReleaseType(const_cast<QPointF *>(a0),sipType_QPointF,a0State);

            return sipRes;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QPolygonF, sipName___contains__, NULL);

    return -1;
}
Пример #2
0
QPainterPath QFontEngineS60Extensions::glyphOutline(glyph_t glyph) const
{
    QPainterPath result;
    QPolygonF polygon;
    TInt glyphIndex = glyph;
    TInt pointNumber = 0;
    TInt x, y;
    while (m_shapingExtension->GlyphPointInFontUnits(glyphIndex, pointNumber++, x, y)) {
        const QPointF point(qreal(x) / 0xffff, qreal(y) / 0xffff);
        if (polygon.contains(point)) {
            result.addPolygon(polygon);
            result.closeSubpath();
            polygon.clear();
        } else {
            polygon.append(point);
        }
    }
    return result;
}