QPainterPath::Element Class

class QPainterPath::Element

QPainterPath::Element 类指定子路径的位置和类型。更多

公共函数

bool isCurveTo() const
bool isLineTo() const
bool isMoveTo() const
QPointF operator QPointF() const
bool operator!=(const QPainterPath::Element &other) const
bool operator==(const QPainterPath::Element &other) const

公共变量

QPainterPath::ElementType type
qreal x
qreal y

详细说明

一旦构建了QPainterPath 对象,就可以向路径中添加线条和曲线等子路径(创建QPainterPath::LineToElementQPainterPath::CurveToElement 组件)。

线条和曲线从currentPosition() 延伸到作为参数传递的位置。QPainterPath 对象的currentPosition() 始终是最后添加的子路径的结束位置(或初始起点)。moveTo() 函数可用于移动currentPosition() 而不添加直线或曲线,从而创建一个QPainterPath::MoveToElement 组件。

另请参阅 QPainterPath

成员函数文档

bool Element::isCurveTo() const

如果元素是曲线,则返回true ,否则返回false

另请参见 typeQPainterPath::CurveToElement

bool Element::isLineTo() const

如果元素是行,则返回true ,否则返回false

另请参见 typeQPainterPath::LineToElement

bool Element::isMoveTo() const

如果元素正在移动当前位置,则返回true ,否则返回false

另请参见 typeQPainterPath::MoveToElement

QPointF Element::operator QPointF() const

返回元素的位置。

另请参阅 xy

bool Element::operator!=(const QPainterPath::Element &other) const

如果该元素不等于other ,则返回true ;否则返回false

另请参阅 operator==() 。

bool Element::operator==(const QPainterPath::Element &other) const

如果该元素等于other ,则返回true ;否则返回false

另请参阅 operator!=() 。

成员变量文档

QPainterPath::ElementType Element::type

该变量保存元素的类型

另请参见 isCurveTo()、isLineTo() 和isMoveTo()。

qreal Element::x

该变量保存元素位置的 x 坐标。

另请参见 operator QPointF()

qreal Element::y

该变量保存元素位置的 Y 坐标。

另请参见 operator QPointF()

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.