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
qv4variantobject_p.h
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
4#ifndef QV4VARIANTOBJECT_P_H
5#define QV4VARIANTOBJECT_P_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 purely as an
12// implementation detail. 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 <QtCore/qglobal.h>
19#include <QtQml/qqmllist.h>
20#include <QtCore/qvariant.h>
21
22#include <private/qv4value_p.h>
23#include <private/qv4object_p.h>
24
26
27namespace QV4 {
28
29namespace Heap {
30
32{
33 void init();
34 void init(const QMetaType type, const void *data);
35 void destroy() {
36 Q_ASSERT(scarceData);
37 if (isScarce())
39 delete scarceData;
40 Object::destroy();
41 }
42 bool isScarce() const;
44
45 const QVariant &data() const { return scarceData->data; }
46 QVariant &data() { return scarceData->data; }
47
48 void addVmePropertyReference() { scarceData->node.remove(); }
50
51private:
53};
54
55}
56
57struct Q_QML_EXPORT VariantObject : Object
58{
60 V4_PROTOTYPE(variantPrototype)
62
63 void addVmePropertyReference() const;
64 void removeVmePropertyReference() const;
65
66protected:
67 static bool virtualIsEqualTo(Managed *m, Managed *other);
68};
69
71{
72public:
73 V4_PROTOTYPE(objectPrototype)
74 void init();
75
76 static ReturnedValue method_preserve(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
77 static ReturnedValue method_destroy(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
78 static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
79 static ReturnedValue method_valueOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
80};
81
82}
83
85
86#endif
87
void remove()
If in a list, remove this node otherwise do nothing.
\inmodule QtCore
Definition qmetatype.h:341
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
quint64 ReturnedValue
const GLfloat * m
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat f
GLenum type
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define V4_NEEDS_DESTROY
#define V4_PROTOTYPE(p)
#define V4_OBJECT2(DataClass, superClass)
QSharedPointer< T > other(t)
[5]
QIntrusiveList< ScarceResourceData, &ScarceResourceData::node > scarceResources
const QVariant & data() const
Heap::InternalClass * internalClass() const
static ReturnedValue method_destroy(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_valueOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_preserve(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)