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
qharmonyjsobjectref.h
Go to the documentation of this file.
1// Copyright (C) 2026 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#ifndef QHARMONYJSOBJECTREF_H
5#define QHARMONYJSOBJECTREF_H
6
7#include <QtCore/qglobal.h>
8
9#if defined(Q_QDOC) || defined(Q_OS_HARMONY)
10
11#include <QtCore/qcompare.h>
12#include <QtCore/qharmonyjscontext.h>
13#include <QtCore/qhashfunctions.h>
14#include <cstdint>
15#include <memory>
16#include <napi/native_api.h>
17
18QT_BEGIN_NAMESPACE
19
20class QHarmonyJsObjectRef;
21Q_CORE_EXPORT size_t qHash(const QHarmonyJsObjectRef &key, size_t seed = 0) noexcept;
22
23class Q_CORE_EXPORT QHarmonyJsObjectRef
24{
25public:
26 QHarmonyJsObjectRef();
27 QHarmonyJsObjectRef(const QHarmonyJsObjectRef &other);
28 QHarmonyJsObjectRef(QHarmonyJsObjectRef &&other) noexcept;
29 QHarmonyJsObjectRef &operator=(const QHarmonyJsObjectRef &other);
30 QHarmonyJsObjectRef &operator=(QHarmonyJsObjectRef &&other) noexcept;
31 ~QHarmonyJsObjectRef();
32
33 static QHarmonyJsObjectRef fromValue(QHarmonyJsContext &jsContext, napi_value value);
34
35 napi_value value(QHarmonyJsContext &jsContext) const;
36 bool isNull() const;
37
38private:
39 friend Q_CORE_EXPORT bool comparesEqual(const QHarmonyJsObjectRef &lhs, const QHarmonyJsObjectRef &rhs) noexcept;
40 Q_DECLARE_EQUALITY_COMPARABLE(QHarmonyJsObjectRef)
41 friend Q_CORE_EXPORT size_t qHash(const QHarmonyJsObjectRef &key, size_t seed) noexcept;
42
43 std::int64_t identity() const noexcept;
44
45 class Private;
46 std::shared_ptr<Private> d;
47};
48
49QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QHarmonyJsObjectRef)
50
51QT_END_NAMESPACE
52
53#endif // Q_QDOC || Q_OS_HARMONY
54
55#endif // QHARMONYJSOBJECTREF_H
std::int64_t jsObjectIdentity(QOhosJsState &jsState, QNapi::Object object)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192