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
qtquick3dassetutilsglobal_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QTQUICK3DASSETUTILSGLOBAL_P_H
7#define QTQUICK3DASSETUTILSGLOBAL_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtCore/qglobal.h>
21#include <QtCore/qstring.h>
22#include <QtCore/qhash.h>
23#include <QtQuick3DAssetUtils/qtquick3dassetutilsexports.h>
24#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
25
26QT_BEGIN_NAMESPACE
27
28void Q_QUICK3DASSETUTILS_EXPORT qml_register_types_QtQuick3D_AssetUtils();
29
30class QQuick3DObject;
31
32// Key used by QSSRtObjectMap for runtime object lookup.
33//
34// Only 'name' participates in operator== and qHash, so QMultiHash buckets
35// are partitioned by name. The 'path' field is intentionally excluded from
36// hash/equality to enable a two-phase lookup: first retrieve all entries
37// with a matching name via equal_range(), then filter by 'path' manually.
38// Do NOT add 'path' to operator== or qHash — that would break the path-based
39// lookup in QQuick3DRuntimeLoader::query().
41{
42public:
45
46 friend bool operator==(const QSSGRuntimeObjectNameKey &lhs, const QSSGRuntimeObjectNameKey &rhs) noexcept
47 {
48 return lhs.name == rhs.name;
49 }
50
51 friend size_t qHash(const QSSGRuntimeObjectNameKey &key, size_t seed = 0) noexcept
52 {
53 return qHash(key.name, seed);
54 }
55
56};
57
58using QSSGRuntimeObjectTypeKey = QSSGRenderGraphObject::BaseType;
59
60using QSSGRuntimeObjectNameMap = QMultiHash<QSSGRuntimeObjectNameKey, QPointer<QQuick3DObject>>;
61using QSSGRuntimeObjectTypeMap = QMultiHash<QSSGRuntimeObjectTypeKey, QPointer<QQuick3DObject>>;
62
63QT_END_NAMESPACE
64
65#endif // QTQUICK3DASSETUTILSGLOBAL_P_H
friend bool operator==(const QSSGRuntimeObjectNameKey &lhs, const QSSGRuntimeObjectNameKey &rhs) noexcept
friend size_t qHash(const QSSGRuntimeObjectNameKey &key, size_t seed=0) noexcept
Combined button and popup list for selecting options.
static void boxBoundsRecursive(const QQuick3DNode *baseNode, const QQuick3DNode *node, QQuick3DBounds3 &accBounds)
static void applyToModels(QQuick3DObject *obj, Func &&lambda)
static QSSGRenderGraphObject::BaseType queryFilterToBaseType(QQuick3DRuntimeLoader::QueryFilter filter)