1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "qquickcumulativedirection_p.h" |
5 | QT_BEGIN_NAMESPACE |
6 | |
7 | /*! |
8 | \qmltype CumulativeDirection |
9 | \instantiates QQuickCumulativeDirection |
10 | \inqmlmodule QtQuick.Particles |
11 | \inherits Direction |
12 | \brief For specifying a direction made of other directions. |
13 | \ingroup qtquick-particles |
14 | |
15 | The CumulativeDirection element will act as a direction that sums the directions within it. |
16 | */ |
17 | QQuickCumulativeDirection::QQuickCumulativeDirection(QObject *parent):QQuickDirection(parent) |
18 | { |
19 | } |
20 | |
21 | QQmlListProperty<QQuickDirection> QQuickCumulativeDirection::directions() |
22 | { |
23 | return QQmlListProperty<QQuickDirection>(this, &m_directions);//TODO: Proper list property |
24 | } |
25 | |
26 | QPointF QQuickCumulativeDirection::sample(const QPointF &from) |
27 | { |
28 | QPointF ret; |
29 | foreach (QQuickDirection* dir, m_directions) |
30 | ret += dir->sample(from); |
31 | return ret; |
32 | } |
33 | |
34 | QT_END_NAMESPACE |
35 | |
36 | #include "moc_qquickcumulativedirection_p.cpp" |
37 |