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
infinitegrid_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DINFINITEGRID_H
5#define QQUICK3DINFINITEGRID_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DHelpers/qtquick3dhelpersexports.h>
19#include <QQuick3DObject>
20
21QT_BEGIN_NAMESPACE
22
23class QQuick3DSceneEnvironment;
24
25class Q_QUICK3DHELPERS_EXPORT QQuick3DInfiniteGrid : public QObject, public QQmlParserStatus
26{
27 Q_OBJECT
28 Q_INTERFACES(QQmlParserStatus)
29
30 QML_NAMED_ELEMENT(InfiniteGrid)
31 Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
32 Q_PROPERTY(float gridInterval READ gridInterval WRITE setGridInterval NOTIFY gridIntervalChanged)
33 Q_PROPERTY(bool gridAxes READ gridAxes WRITE setGridAxes NOTIFY gridAxesChanged)
34
35public:
36 QQuick3DInfiniteGrid();
37 ~QQuick3DInfiniteGrid() override;
38 bool visible() const;
39 void setVisible(bool newVisible);
40 float gridInterval() const;
41 void setGridInterval(float newGridInterval);
42 void componentComplete() override;
43 void classBegin() override;
44
45 bool gridAxes() const;
46 void setGridAxes(bool newGridAxes);
47
48signals:
49 void visibleChanged();
50 void gridIntervalChanged();
51
52 void gridAxesChanged();
53
54private:
55 void updateGridFlags();
56 bool m_visible = true;
57 float m_gridInterval = 1.0f;
58 QQuick3DSceneEnvironment *m_sceneEnv = nullptr;
59 bool m_componentComplete = false;
60 bool m_gridAxes = true;
61};
62
63QT_END_NAMESPACE
64
65#endif // QQUICK3DINFINITEGRID_H