Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqmlpropertymap.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
// Qt-Security score:significant
4
5
#
ifndef
QQMLPROPERTYMAP_H
6
#
define
QQMLPROPERTYMAP_H
7
8
#
include
<
QtQml
/
qtqmlglobal
.
h
>
9
#
include
<
QtQml
/
qqmlregistration
.
h
>
10
#
include
<
QtQml
/
qqmlprivate
.
h
>
11
12
#
include
<
QtCore
/
QObject
>
13
#
include
<
QtCore
/
QHash
>
14
#
include
<
QtCore
/
QStringList
>
15
#
include
<
QtCore
/
QVariant
>
16
17
QT_BEGIN_NAMESPACE
18
19
20
class
QQmlPropertyMapPrivate;
21
class
Q_QML_EXPORT
QQmlPropertyMap
:
public
QObject
22
{
23
Q_OBJECT
24
QML_ANONYMOUS
25
public
:
26
#
if
QT_DEPRECATED_SINCE
(
6
,
11
)
27
QT_DEPRECATED_VERSION_X_6_11(
"Use create() or the protected two-argument constructor instead."
)
28
explicit
QQmlPropertyMap(QObject *parent =
nullptr
);
29
#
endif
30
31
static
QQmlPropertyMap *create(QObject *parent =
nullptr
);
32
33
~QQmlPropertyMap() override;
34
35
QVariant value(
const
QString &key)
const
;
36
void
insert(
const
QString &key,
const
QVariant &value);
37
void
insert(
const
QVariantHash &values);
38
void
clear(
const
QString &key);
39
void
freeze();
40
41
Q_INVOKABLE QStringList keys()
const
;
42
43
int
count()
const
;
44
int
size()
const
;
45
bool
isEmpty()
const
;
46
bool
contains(
const
QString &key)
const
;
47
48
QVariant &operator[](
const
QString &key);
49
QVariant operator[](
const
QString &key)
const
;
50
51
Q_SIGNALS:
52
void
valueChanged(
const
QString &key,
const
QVariant &value);
53
54
protected
:
55
virtual
QVariant updateValue(
const
QString &key,
const
QVariant &input);
56
57
template
<
class
DerivedType>
58
QQmlPropertyMap(DerivedType *derived, QObject *parentObj)
59
: QQmlPropertyMap(&DerivedType::staticMetaObject, parentObj)
60
{
61
Q_UNUSED(derived);
62
}
63
64
private
:
65
friend
class
QtPrivate::QMetaTypeForType<QQmlPropertyMap>;
66
67
QQmlPropertyMap(
const
QMetaObject *staticMetaObject, QObject *parent);
68
69
Q_DECLARE_PRIVATE(QQmlPropertyMap)
70
Q_DISABLE_COPY(QQmlPropertyMap)
71
};
72
73
namespace
QtPrivate
{
74
template
<>
75
constexpr
QMetaTypeInterface
::
DefaultCtrFn
QMetaTypeForType
<
QQmlPropertyMap
>::
getDefaultCtr
()
76
{
77
return
[](
const
QMetaTypeInterface
*,
void
*
addr
) {
78
new
(
addr
)
QQmlPropertyMap
(&
QQmlPropertyMap
::
staticMetaObject
,
nullptr
);
79
};
80
}
81
}
82
83
namespace
QQmlPrivate
{
84
85
// Specialization of QQmlElement for QQmlPropertyMap, for the rare case
86
// when you'd want to register QQmlPropertyMap directly, rather than some
87
// derived class of it.
88
template
<>
89
inline
QQmlElement
<
QQmlPropertyMap
>::
QQmlElement
() :
QQmlPropertyMap
(
this
,
nullptr
) {}
90
91
}
92
93
QT_END_NAMESPACE
94
95
#
endif
QQmlPropertyMapMetaObject
Definition
qqmlpropertymap.cpp:17
QQmlPropertyMapMetaObject::propertyName
const QString & propertyName(int index)
QQmlPropertyMapMetaObject::propertyWritten
void propertyWritten(int index) override
Definition
qqmlpropertymap.cpp:87
QQmlPropertyMapMetaObject::propertyWriteValue
QVariant propertyWriteValue(int, const QVariant &) override
Definition
qqmlpropertymap.cpp:82
QQmlPropertyMapMetaObject::propertyCreated
void propertyCreated(int, QMetaPropertyBuilder &) override
Definition
qqmlpropertymap.cpp:92
QQmlPropertyMapMetaObject::QQmlPropertyMapMetaObject
QQmlPropertyMapMetaObject(QQmlPropertyMap *obj, QQmlPropertyMapPrivate *objPriv, const QMetaObject *staticMetaObject)
Definition
qqmlpropertymap.cpp:75
QQmlPropertyMapPrivate
Definition
qqmlpropertymap.cpp:34
QQmlPropertyMapPrivate::updateValue
QVariant updateValue(const QString &key, const QVariant &input)
Definition
qqmlpropertymap.cpp:57
QQmlPropertyMapPrivate::emitChanged
void emitChanged(const QString &key, const QVariant &value)
Definition
qqmlpropertymap.cpp:63
QQmlPropertyMapPrivate::propertyName
const QString & propertyName(int index) const
Definition
qqmlpropertymap.cpp:69
QQmlPropertyMapPrivate::keys
QStringList keys
Definition
qqmlpropertymap.cpp:38
QQmlPropertyMapPrivate::validKeyName
static bool validKeyName(const QString &name)
Definition
qqmlpropertymap.cpp:47
QQmlPropertyMap
The QQmlPropertyMap class allows you to set key-value pairs that can be used in QML bindings.
Definition
qqmlpropertymap.h:22
QQmlPrivate
Definition
qv4compileddata_p.h:67
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtPrivate
Definition
qalloc.h:29
qtdeclarative
src
qml
util
qqmlpropertymap.h
Generated on
for Qt by
1.18.0