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
qplaceattribute.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 reason:default
4
5#ifndef QPLACEATTRIBUTE_H
6#define QPLACEATTRIBUTE_H
7
8#include <QtCore/QString>
9#include <QtCore/QMetaType>
10#include <QtCore/QSharedDataPointer>
11
12#include <QtLocation/qlocationglobal.h>
13#include <QtQml/qqml.h>
14
16
17class QPlaceAttributePrivate;
18QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceAttributePrivate, Q_LOCATION_EXPORT)
19
20class Q_LOCATION_EXPORT QPlaceAttribute
21{
22 Q_GADGET
23 QML_VALUE_TYPE(placeAttribute)
24 QML_STRUCTURED_VALUE
25 Q_PROPERTY(QString label READ label WRITE setLabel)
26 Q_PROPERTY(QString text READ text WRITE setText)
27
28public:
29 static const QString OpeningHours;
30 static const QString Payment;
31 static const QString Provider;
32
33 QPlaceAttribute();
34 QPlaceAttribute(const QPlaceAttribute &other) noexcept;
35 QPlaceAttribute(QPlaceAttribute &&other) noexcept = default;
36 ~QPlaceAttribute();
37
38 QPlaceAttribute &operator=(const QPlaceAttribute &other) noexcept;
39 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPlaceAttribute)
40
41 void swap(QPlaceAttribute &other) noexcept { d_ptr.swap(other.d_ptr); }
42
43 friend inline bool operator==(const QPlaceAttribute &lhs, const QPlaceAttribute &rhs) noexcept
44 { return lhs.isEqual(rhs); }
45 friend inline bool operator!=(const QPlaceAttribute &lhs, const QPlaceAttribute &rhs) noexcept
46 { return !lhs.isEqual(rhs); }
47
48 QString label() const;
49 void setLabel(const QString &label);
50
51 QString text() const;
52 void setText(const QString &text);
53
54 bool isEmpty() const;
55
56private:
57 QSharedDataPointer<QPlaceAttributePrivate> d_ptr;
58 bool isEqual(const QPlaceAttribute &other) const noexcept;
59};
60
61QT_END_NAMESPACE
62
63Q_DECLARE_METATYPE(QPlaceAttribute)
64
65#endif
\inmodule QtLocation
Combined button and popup list for selecting options.