本文整理汇总了C++中QPolygonF::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ QPolygonF::contains方法的具体用法?C++ QPolygonF::contains怎么用?C++ QPolygonF::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPolygonF
的用法示例。
在下文中一共展示了QPolygonF::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slot_QPolygonF___contains__
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: point
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;
}