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
cppqml.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QtCore/QObject>
5#include <QtCore/QVariant>
6#include <QtLocation/QPlaceCategory>
7#include <QtLocation/QPlaceContactDetail>
8#include <QtLocation/QPlace>
9#include <QtLocation/QPlaceAttribute>
10#include <QtLocation/QPlaceIcon>
11#include <QtLocation/QPlaceUser>
12#include <QtLocation/QPlaceRatings>
13#include <QtLocation/QPlaceSupplier>
14
15void cppQmlInterface(QObject *qmlObject)
16{
17 //! [Category get]
18 QPlaceCategory category = qmlObject->property("category").value<QPlaceCategory>();
19 //! [Category get]
20
21 //! [Category set]
22 qmlObject->setProperty("category", QVariant::fromValue(category));
23 //! [Category set]
24
25 //! [ContactDetail get]
26 QPlaceContactDetail contactDetail = qmlObject->property("contactDetail").value<QPlaceContactDetail>();
27 //! [ContactDetail get]
28
29 //! [ContactDetail set]
30 qmlObject->setProperty("contactDetail", QVariant::fromValue(contactDetail));
31 //! [ContactDetail set]
32
33 //! [Place get]
34 QPlace place = qmlObject->property("place").value<QPlace>();
35 //! [Place get]
36
37 //! [Place set]
38 qmlObject->setProperty("place", QVariant::fromValue(place));
39 //! [Place set]
40
41 //! [PlaceAttribute get]
42 QPlaceAttribute placeAttribute = qmlObject->property("attribute").value<QPlaceAttribute>();
43 //! [PlaceAttribute get]
44
45 //! [PlaceAttribute set]
46 qmlObject->setProperty("attribute", QVariant::fromValue(placeAttribute));
47 //! [PlaceAttribute set]
48
49 //! [Icon get]
50 QPlaceIcon placeIcon = qmlObject->property("icon").value<QPlaceIcon>();
51 //! [Icon get]
52
53 //! [Icon set]
54 qmlObject->setProperty("icon", QVariant::fromValue(placeIcon));
55 //! [Icon set]
56
57 //! [User get]
58 QPlaceUser placeUser = qmlObject->property("user").value<QPlaceUser>();
59 //! [User get]
60
61 //! [User set]
62 qmlObject->setProperty("user", QVariant::fromValue(placeUser));
63 //! [User set]
64
65 //! [Ratings get]
66 QPlaceRatings placeRatings = qmlObject->property("ratings").value<QPlaceRatings>();
67 //! [Ratings get]
68
69 //! [Ratings set]
70 qmlObject->setProperty("ratings", QVariant::fromValue(placeRatings));
71 //! [Ratings set]
72
73 //! [Supplier get]
74 QPlaceSupplier placeSupplier = qmlObject->property("supplier").value<QPlaceSupplier>();
75 //! [Supplier get]
76
77 //! [Supplier set]
78 qmlObject->setProperty("supplier", QVariant::fromValue(placeSupplier));
79 //! [Supplier set]
80}
void cppQmlInterface(QObject *qmlObject)
Definition cppqml.cpp:15