1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtGraphs API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef DECLARATIVESCENE_P_H
15#define DECLARATIVESCENE_P_H
16
17#include <QtQml/qqml.h>
18#include <private/graphsglobal_p.h>
19#include <QtGraphs/q3dscene.h>
20
21QT_BEGIN_NAMESPACE
22
23class Declarative3DScene : public Q3DScene
24{
25 Q_OBJECT
26 // This property is overloaded to use QPointF instead of QPoint to work around qml bug
27 // where Qt.point(0, 0) can't be assigned due to error "Cannot assign QPointF to QPoint".
28 Q_PROPERTY(QPointF selectionQueryPosition READ selectionQueryPosition WRITE setSelectionQueryPosition NOTIFY selectionQueryPositionChanged)
29 // This is static method in parent class, overload as constant property for qml.
30 Q_PROPERTY(QPoint invalidSelectionPoint READ invalidSelectionPoint CONSTANT)
31
32 QML_NAMED_ELEMENT(Scene3D)
33 QML_UNCREATABLE("Trying to create uncreatable: Scene3D.")
34
35public:
36 Declarative3DScene(QObject *parent = 0);
37 virtual ~Declarative3DScene();
38
39 void setSelectionQueryPosition(const QPointF &point);
40 QPointF selectionQueryPosition() const;
41 QPoint invalidSelectionPoint() const;
42
43Q_SIGNALS:
44 void selectionQueryPositionChanged(const QPointF &position);
45};
46
47QT_END_NAMESPACE
48
49#endif
50

source code of qtgraphs/src/graphs/qml/declarativescene_p.h