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
qquickpointdirection.cpp
Go to the documentation of this file.
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
5#include <QRandomGenerator>
6
8
34 QQuickDirection(parent)
35 , m_x(0)
36 , m_y(0)
37 , m_xVariation(0)
38 , m_yVariation(0)
39{
40}
41
43{
45 ret.setX(m_x - m_xVariation + QRandomGenerator::global()->generateDouble() * m_xVariation * 2);
46 ret.setY(m_y - m_yVariation + QRandomGenerator::global()->generateDouble() * m_yVariation * 2);
47 return ret;
48}
49
51
52#include "moc_qquickpointdirection_p.cpp"
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr void setX(qreal x) noexcept
Sets the x coordinate of this point to the given finite x coordinate.
Definition qpoint.h:353
QPointF sample(const QPointF &from) override
QQuickPointDirection(QObject *parent=nullptr)
\qmltype PointDirection \instantiates QQuickPointDirection \inqmlmodule QtQuick.Particles\inherits Di...
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
Definition qrandom.h:275
Combined button and popup list for selecting options.
return ret
return generateDouble() *highest
[11]