Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickpath.cpp File Reference

(01cd43d30e3ca2c4dd94a4a4711604adb9417517)

#include "qquickpath_p.h"
#include "qquickpath_p_p.h"
#include "qquicksvgparser_p.h"
#include <QSet>
#include <QTime>
#include <private/qbezier_p.h>
#include <QtCore/qmath.h>
#include <QtCore/private/qnumeric_p.h>
#include "moc_qquickpath_p.cpp"
Include dependency graph for qquickpath.cpp:

Go to the source code of this file.

Functions

static QQuickPathPrivateprivatePath (QObject *object)
static void scalePath (QPainterPath &path, const QSizeF &scale)
static QBezier nextBezier (const QPainterPath &path, int *current, qreal *bezLength, bool reverse=false)
static int segmentCount (const QPainterPath &path, qreal pathLength)
static qreal slopeAt (qreal t, qreal a, qreal b, qreal c, qreal d)
QDebug operator<< (QDebug debug, const QQuickCurve *curve)
QPointF positionForCurve (const QQuickPathData &data, const QPointF &prevPoint)
 \qmltype PathLine \nativetype QQuickPathLine \inqmlmodule QtQuick
QPointF previousPathPosition (const QPainterPath &path)
 \qmltype PathCurve \nativetype QQuickPathCatmullRomCurve \inqmlmodule QtQuick

Function Documentation

◆ nextBezier()

QBezier nextBezier ( const QPainterPath & path,
int * current,
qreal * bezLength,
bool reverse = false )
inlinestatic

Definition at line 696 of file qquickpath.cpp.

◆ operator<<()

QDebug operator<< ( QDebug debug,
const QQuickCurve * curve )

Definition at line 1177 of file qquickpath.cpp.

◆ positionForCurve()

QPointF positionForCurve ( const QQuickPathData & data,
const QPointF & prevPoint )
inline

\qmltype PathLine \nativetype QQuickPathLine \inqmlmodule QtQuick

Defines a straight line.

The example below creates a path consisting of a straight line from 0,100 to 200,100:

\qml Path { startX: 0; startY: 100 PathLine { x: 200; y: 100 } } \endqml

See also
Path, PathQuad, PathCubic, PathArc, PathAngleArc, PathCurve, PathSvg, PathMove, PathPolyline, PathRectangle

\qmlproperty real QtQuick::PathLine::x \qmlproperty real QtQuick::PathLine::y

Defines the end point of the line.

See also
relativeX, relativeY

\qmlproperty real QtQuick::PathLine::relativeX \qmlproperty real QtQuick::PathLine::relativeY

Defines the end point of the line relative to its start.

If both a relative and absolute end position are specified for a single axis, the relative position will be used.

Relative and absolute positions can be mixed, for example it is valid to set a relative x and an absolute y.

See also
x, y

Definition at line 1355 of file qquickpath.cpp.

References QQuickPathData::index.

◆ previousPathPosition()

QPointF previousPathPosition ( const QPainterPath & path)
inline

\qmltype PathCurve \nativetype QQuickPathCatmullRomCurve \inqmlmodule QtQuick

Defines a point on a Catmull-Rom curve.

PathCurve provides an easy way to specify a curve passing directly through a set of points. Typically multiple PathCurves are used in a series, as the following example demonstrates:

import QtQuick
Canvas {
width: 400; height: 200
contextType: "2d"
Path {
id: myPath
startX: 0; startY: 100
PathCurve { x: 75; y: 75 }
PathCurve { x: 200; y: 150 }
PathCurve { x: 325; y: 25 }
PathCurve { x: 400; y: 100 }
}
onPaint: {
context.strokeStyle = Qt.rgba(.4,.6,.8);
context.path = myPath;
context.stroke();
}
}

This example produces the following path (with the starting point and PathCurve points highlighted in red):

See also
Path, PathLine, PathQuad, PathCubic, PathArc, PathSvg

\qmlproperty real QtQuick::PathCurve::x \qmlproperty real QtQuick::PathCurve::y

Defines the end point of the curve.

See also
relativeX, relativeY

\qmlproperty real QtQuick::PathCurve::relativeX \qmlproperty real QtQuick::PathCurve::relativeY

Defines the end point of the curve relative to its start.

If both a relative and absolute end position are specified for a single axis, the relative position will be used.

Relative and absolute positions can be mixed, for example it is valid to set a relative x and an absolute y.

See also
x, y

Definition at line 1848 of file qquickpath.cpp.

◆ privatePath()

QQuickPathPrivate * privatePath ( QObject * object)
static

Definition at line 291 of file qquickpath.cpp.

◆ scalePath()

void scalePath ( QPainterPath & path,
const QSizeF & scale )
inlinestatic

Definition at line 448 of file qquickpath.cpp.

◆ segmentCount()

int segmentCount ( const QPainterPath & path,
qreal pathLength )
inlinestatic

Definition at line 734 of file qquickpath.cpp.

◆ slopeAt()

qreal slopeAt ( qreal t,
qreal a,
qreal b,
qreal c,
qreal d )
inlinestatic

Definition at line 749 of file qquickpath.cpp.