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
src_qml_qqmlpropertymap.cpp
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
//! [0]
5
class
MyQmlPropertyMap
:
public
QQmlPropertyMap
6
{
7
Q_OBJECT
8
QML_NAMED_ELEMENT(
MyQmlPropertyMap
)
9
public
:
10
explicit
MyQmlPropertyMap
(
QObject
*
parent
=
nullptr
)
11
:
QQmlPropertyMap
(
this
,
parent
)
12
{
13
insert
(
"name"
,
"John Smith"
);
14
insert
(
"phone"
,
"555-5555"
);
15
insert
(
"email"
,
"john.smith@example.com"
);
16
}
17
18
public
slots
:
19
void
updateEmail
(
const
QString
&
newEmail
)
20
{
21
insert
(
"email"
,
newEmail
);
22
}
23
};
24
//! [0]
25
26
void
wrapper1
() {
27
//! [1]
28
QQuickView view;
29
view.setSource(QUrl(
"qrc:/main.qml"
));
30
view.show();
31
//! [1]
32
}
MyQmlPropertyMap
[0]
Definition
src_qml_qqmlpropertymap.cpp:6
wrapper1
void wrapper1()
[0]
Definition
src_qml_qqmlpropertymap.cpp:26
qtdeclarative
src
qml
doc
snippets
code
src_qml_qqmlpropertymap.cpp
Generated on
for Qt by
1.14.0