![]() |
Qt 6.x
The Qt SDK
|
#include <qquickshape_p_p.h>
Additional Inherited Members | |
![]() | |
enum | ChangeType { Geometry = 0x01 , SiblingOrder = 0x02 , Visibility = 0x04 , Opacity = 0x08 , Destroyed = 0x10 , Parent = 0x20 , Children = 0x40 , Rotation = 0x80 , ImplicitWidth = 0x100 , ImplicitHeight = 0x200 , Enabled = 0x400 , Focus = 0x800 , AllChanges = 0xFFFFFFFF } |
enum | ExtraDataTag { NoTag = 0x1 , LeftMouseButtonAccepted = 0x2 } |
enum | DirtyType { TransformOrigin = 0x00000001 , Transform = 0x00000002 , BasicTransform = 0x00000004 , Position = 0x00000008 , Size = 0x00000010 , ZValue = 0x00000020 , Content = 0x00000040 , Smooth = 0x00000080 , OpacityValue = 0x00000100 , ChildrenChanged = 0x00000200 , ChildrenStackingChanged = 0x00000400 , ParentChanged = 0x00000800 , Clip = 0x00001000 , Window = 0x00002000 , EffectReference = 0x00008000 , Visible = 0x00010000 , HideReference = 0x00020000 , Antialiasing = 0x00040000 , TransformUpdateMask , ComplexTransformUpdateMask = Transform | Window , ContentUpdateMask = Size | Content | Smooth | Window | Antialiasing , ChildrenUpdateMask = ChildrenChanged | ChildrenStackingChanged | EffectReference | Window } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
![]() | |
void | setCurrentColorGroup () |
Definition at line 122 of file qquickshape_p_p.h.
QQuickShapePrivate::QQuickShapePrivate | ( | ) |
Renders a path.
\qmltype Shape
! \instantiates QQuickShape \inqmlmodule QtQuick.Shapes
\inherits Item
Renders a path by triangulating geometry from a QPainterPath.
This approach is different from rendering shapes via QQuickPaintedItem or the 2D Canvas because the path never gets rasterized in software. Therefore Shape is suitable for creating shapes spreading over larger areas of the screen, avoiding the performance penalty for texture uploads or framebuffer blits. In addition, the declarative API allows manipulating, binding to, and even animating the path element properties like starting and ending position, the control points, and so on.
The types for specifying path elements are shared between \l PathView and Shape. However, not all Shape implementations support all path element types, while some may not make sense for PathView. Shape's currently supported subset is: PathMove, PathLine, PathQuad, PathCubic, PathArc, PathText and PathSvg.
See \l Path for a detailed overview of the supported path elements.
\qml Shape { width: 200 height: 150 anchors.centerIn: parent ShapePath { strokeWidth: 4 strokeColor: "red" fillGradient: LinearGradient { x1: 20; y1: 20 x2: 180; y2: 130 GradientStop { position: 0; color: "blue" } GradientStop { position: 0.2; color: "green" } GradientStop { position: 0.4; color: "red" } GradientStop { position: 0.6; color: "yellow" } GradientStop { position: 1; color: "cyan" } } strokeStyle: ShapePath.DashLine dashPattern: [ 1, 4 ] startX: 20; startY: 20 PathLine { x: 180; y: 130 } PathLine { x: 20; y: 130 } PathLine { x: 20; y: 20 } } } \endqml
Like \l Item, Shape also allows any visual or non-visual objects to be declared as children. ShapePath objects are handled specially. This is useful since it allows adding visual items, like \l Rectangle or \l Image, and non-visual objects, like \l Timer directly as children of Shape.
The following list summarizes the available Shape rendering approaches:
\list
software
backend is fully supported. The path is rendered via QPainter::strokePath() and QPainter::fillPath() in this case.\endlist
When using Shape, it is important to be aware of potential performance implications:
\list
\endlist
Definition at line 628 of file qquickshape.cpp.
QQuickShapePrivate::~QQuickShapePrivate | ( | ) |
Definition at line 633 of file qquickshape.cpp.
References renderer.
void QQuickShapePrivate::_q_shapePathChanged | ( | ) |
Definition at line 638 of file qquickshape.cpp.
Definition at line 1162 of file qquickshape.cpp.
References QQuickItemPrivate::data(), qDebug, and QQuickShape::Ready.
Referenced by sync().
QSGNode * QQuickShapePrivate::createNode | ( | ) |
Definition at line 1127 of file qquickshape.cpp.
References QQuickShape::CurveRenderer, QSGRendererInterface::graphicsApi(), QSGRendererInterface::isApiRhiBased(), qWarning, renderer, rendererType, and QSGRendererInterface::Software.
void QQuickShapePrivate::createRenderer | ( | ) |
Definition at line 1100 of file qquickshape.cpp.
References QQuickShape::CurveRenderer, QQuickShape::GeometryRenderer, renderer, rendererChanged, rendererType, selectRendererType(), QQuickShape::SoftwareRenderer, and QQuickShape::UnknownRenderer.
|
inlinestatic |
Definition at line 138 of file qquickshape_p_p.h.
References item.
Referenced by QDeclarativeGeoMapItemBase::setShapeTriangulationScale(), vpe_append(), and vpe_clear().
QQuickShape::RendererType QQuickShapePrivate::selectRendererType | ( | ) |
Definition at line 1068 of file qquickshape.cpp.
References QQuickShape::CurveRenderer, QQuickShape::GeometryRenderer, QSGRendererInterface::graphicsApi(), QSGRendererInterface::isApiRhiBased(), preferredType, qEnvironmentVariable(), qWarning, QSGRendererInterface::Software, QQuickShape::SoftwareRenderer, QString::toLower(), and QQuickShape::UnknownRenderer.
Referenced by createRenderer().
void QQuickShapePrivate::setStatus | ( | QQuickShape::Status | newStatus | ) |
Definition at line 646 of file qquickshape.cpp.
Referenced by sync().
void QQuickShapePrivate::sync | ( | ) |
Definition at line 1171 of file qquickshape.cpp.
References async, asyncShapeReady(), QQuickAbstractPathRenderer::beginSync(), QQuickItemPrivate::dirty(), QQuickShapePathPrivate::DirtyDash, QQuickShapePathPrivate::DirtyFillColor, QQuickShapePathPrivate::DirtyFillGradient, QQuickShapePathPrivate::DirtyFillRule, QQuickShapePathPrivate::DirtyPath, QQuickShapePathPrivate::DirtyStrokeColor, QQuickShapePathPrivate::DirtyStrokeWidth, QQuickShapePathPrivate::DirtyStyle, QElapsedTimer::elapsed(), QQuickAbstractPathRenderer::endSync(), QQuickAbstractPathRenderer::flags(), QQuickShapePathPrivate::get(), i, QQuickShape::Processing, qDebug, QQuickShape::Ready, renderer, QQuickAbstractPathRenderer::setAsyncCallback(), QQuickAbstractPathRenderer::setCapStyle(), QQuickAbstractPathRenderer::setFillColor(), QQuickAbstractPathRenderer::setFillGradient(), QQuickAbstractPathRenderer::setFillRule(), QQuickAbstractPathRenderer::setJoinStyle(), QQuickAbstractPathRenderer::setPath(), setStatus(), QQuickAbstractPathRenderer::setStrokeColor(), QQuickAbstractPathRenderer::setStrokeStyle(), QQuickAbstractPathRenderer::setStrokeWidth(), QQuickAbstractPathRenderer::setTriangulationScale(), sp, QElapsedTimer::start(), QQuickAbstractPathRenderer::SupportsAsync, syncTimeCounter, syncTimer, syncTimingActive, syncTimingTotalDirty, and triangulationScale.
bool QQuickShapePrivate::async = false |
Definition at line 154 of file qquickshape_p_p.h.
Referenced by sync().
QQuickShape::ContainsMode QQuickShapePrivate::containsMode = QQuickShape::BoundingRectContains |
Definition at line 151 of file qquickshape_p_p.h.
int QQuickShapePrivate::effectRefCount |
Definition at line 142 of file qquickshape_p_p.h.
bool QQuickShapePrivate::enableVendorExts = false |
Definition at line 155 of file qquickshape_p_p.h.
QQuickShape::RendererType QQuickShapePrivate::preferredType = QQuickShape::UnknownRenderer |
Definition at line 150 of file qquickshape_p_p.h.
Referenced by selectRendererType().
QQuickAbstractPathRenderer* QQuickShapePrivate::renderer = nullptr |
Definition at line 145 of file qquickshape_p_p.h.
Referenced by ~QQuickShapePrivate(), createNode(), createRenderer(), and sync().
bool QQuickShapePrivate::rendererChanged = false |
Definition at line 153 of file qquickshape_p_p.h.
Referenced by createRenderer().
QQuickShape::RendererType QQuickShapePrivate::rendererType = QQuickShape::UnknownRenderer |
Definition at line 149 of file qquickshape_p_p.h.
Referenced by createNode(), and createRenderer().
QVector<QQuickShapePath *> QQuickShapePrivate::sp |
Definition at line 143 of file qquickshape_p_p.h.
Referenced by sync().
bool QQuickShapePrivate::spChanged = false |
Definition at line 152 of file qquickshape_p_p.h.
Referenced by _q_shapePathChanged().
QQuickShape::Status QQuickShapePrivate::status = QQuickShape::Null |
Definition at line 148 of file qquickshape_p_p.h.
Referenced by setStatus().
int QQuickShapePrivate::syncTimeCounter = 0 |
Definition at line 147 of file qquickshape_p_p.h.
Referenced by sync().
QElapsedTimer QQuickShapePrivate::syncTimer |
Definition at line 144 of file qquickshape_p_p.h.
Referenced by sync().
bool QQuickShapePrivate::syncTimingActive = false |
Definition at line 156 of file qquickshape_p_p.h.
Referenced by sync().
int QQuickShapePrivate::syncTimingTotalDirty = 0 |
Definition at line 146 of file qquickshape_p_p.h.
Referenced by sync().
qreal QQuickShapePrivate::triangulationScale = 1.0 |
Definition at line 157 of file qquickshape_p_p.h.
Referenced by QDeclarativeGeoMapItemBase::setShapeTriangulationScale(), and sync().