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
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{
18 QPlaceCategory category = qmlObject->property("category").value<QPlaceCategory>();
20
22 qmlObject->setProperty("category", QVariant::fromValue(category));
24
26 QPlaceContactDetail contactDetail = qmlObject->property("contactDetail").value<QPlaceContactDetail>();
28
30 qmlObject->setProperty("contactDetail", QVariant::fromValue(contactDetail));
32
34 QPlace place = qmlObject->property("place").value<QPlace>();
36
38 qmlObject->setProperty("place", QVariant::fromValue(place));
40
42 QPlaceAttribute placeAttribute = qmlObject->property("attribute").value<QPlaceAttribute>();
44
46 qmlObject->setProperty("attribute", QVariant::fromValue(placeAttribute));
48
50 QPlaceIcon placeIcon = qmlObject->property("icon").value<QPlaceIcon>();
52
54 qmlObject->setProperty("icon", QVariant::fromValue(placeIcon));
56
58 QPlaceUser placeUser = qmlObject->property("user").value<QPlaceUser>();
60
62 qmlObject->setProperty("user", QVariant::fromValue(placeUser));
64
66 QPlaceRatings placeRatings = qmlObject->property("ratings").value<QPlaceRatings>();
68
70 qmlObject->setProperty("ratings", QVariant::fromValue(placeRatings));
72
74 QPlaceSupplier placeSupplier = qmlObject->property("supplier").value<QPlaceSupplier>();
76
78 qmlObject->setProperty("supplier", QVariant::fromValue(placeSupplier));
80}
81
\inmodule QtCore
Definition qobject.h:103
QVariant property(const char *name) const
Returns the value of the object's name property.
Definition qobject.cpp:4323
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
\inmodule QtLocation
\inmodule QtLocation
The QPlaceContactDetail class represents a contact detail such as a phone number or website url.
\inmodule QtLocation
Definition qplaceicon.h:23
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
Definition qplaceuser.h:18
\inmodule QtLocation
Definition qplace.h:25
T value() const &
Definition qvariant.h:516
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Definition qvariant.h:536
const QLoggingCategory & category()
[1]
void cppQmlInterface(QObject *qmlObject)
Definition cppqml.cpp:15