Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickshape_p.h File Reference

(31d652d73b20f43b492ba8c306f932ca6fc3a0c1)

#include <QtQuickShapes/private/qquickshapesglobal_p.h>
#include <QtQuick/qquickitem.h>
#include <private/qtquickglobal_p.h>
#include <private/qquickpath_p_p.h>
#include <private/qquickrectangle_p.h>
+ Include dependency graph for qquickshape_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QQuickShapesModule
 
class  QQuickShapeGradient
 
class  QQuickShapeLinearGradient
 
class  QQuickShapeRadialGradient
 
class  QQuickShapeConicalGradient
 
class  QQuickShapePath
 
class  QQuickShape
 

Functions

void Q_QUICKSHAPES_EXPORT QQuickShapes_initializeModule ()
 \qmlmodule QtQuick.Shapes 1.
 

Function Documentation

◆ QQuickShapes_initializeModule()

void Q_QUICKSHAPES_EXPORT QQuickShapes_initializeModule ( )

\qmlmodule QtQuick.Shapes 1.

\QtMinorVersion \title Qt Quick Shapes QML Types

Provides QML types for drawing stroked and filled shapes.

To use the types in this module, import the module with the following line:

\qml import QtQuick.Shapes \endqml

Qt Quick Shapes provides tools for drawing arbitrary shapes in a Qt Quick scene. \l{Shape}{Shapes} can be constructed from basic building blocks like \l{PathLine}{lines} and \l{PathCubic}{curves} that define sub-shapes. The sub-shapes can then be filled with solid colors or gradients, and an outline stroke can be defined.

Qt Quick Shapes also supports higher level path element types, such as \l{PathText}{text} and \l{PathSvg}{SVG path descriptions}. The currently supported element types is: PathMove, PathLine, PathQuad, PathCubic, PathArc, PathText and PathSvg.

Qt Quick Shapes triangulates the shapes and renders the corresponding triangles on the GPU. Therefore, altering the control points of elements will lead to re-triangulation of the affected paths, at some performance cost. In addition, curves are flattened before they are rendered, so applying a very high scale to the shape may show artifacts where it is visible that the curves are represented by a sequence of smaller, straight lines.

Note
By default, Qt Quick Shapes relies on multi-sampling for anti-aliasing. This can be enabled for the entire application or window using the corresponding settings in QSurfaceFormat. It can also be enabled for only the shape, by setting its \l{Item::layer.enabled}{layer.enabled} property to true and then adjusting the \l{Item::layer.samples}{layer.samples} property. In the latter case, multi-sampling will not be applied to the entire scene, but the shape will be rendered via an intermediate off-screen buffer. Alternatively, the \l{QtQuick.Shapes::Shape::preferredRendererType}{preferredRendererType} property can be set to {Shape.CurveRenderer}. This has anti-aliasing built in and generally renders the shapes at a higher quality, but at some additional performance cost.

For further information, the \l{Qt Quick Examples - Shapes}{Shapes example} shows how to implement different types of shapes, fills and strokes, and the \l{Weather Forecast Example} shows examples of different ways shapes might be useful in a user interface.

Definition at line 69 of file qquickshape.cpp.

References QQuickShapesModule::defineModule().

Referenced by QmlShapesPlugin::QmlShapesPlugin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: