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
qdeclarativegeomapcopyrightsnotice_p.h
Go to the documentation of this file.
1// Copyright (C) 2014 Aaron McCarthy <mccarthy.aaron@gmail.com>
2// Copyright (C) 2022 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QDECLARATIVEGEOMAPCOPYRIGHTSNOTICE_H
7#define QDECLARATIVEGEOMAPCOPYRIGHTSNOTICE_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtLocation/private/qlocationglobal_p.h>
21
22#include <QtGui/QImage>
23#include <QPointer>
24#include <QtQuick/QQuickPaintedItem>
25
26Q_MOC_INCLUDE(<QtLocation/private/qdeclarativegeomap_p.h>)
27
28
29QT_BEGIN_NAMESPACE
30
31class QTextDocument;
32class QDeclarativeGeoMap;
34class Q_LOCATION_EXPORT QDeclarativeGeoMapCopyrightNotice : public QQuickPaintedItem
35{
36 Q_OBJECT
37 QML_NAMED_ELEMENT(MapCopyrightNotice)
38 QML_ADDED_IN_VERSION(5, 0)
39
40 Q_PROPERTY(QDeclarativeGeoMap *mapSource READ mapSource WRITE setMapSource NOTIFY mapSourceChanged)
41 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet NOTIFY styleSheetChanged)
42
43public:
44 QDeclarativeGeoMapCopyrightNotice(QQuickItem *parent = nullptr);
45 ~QDeclarativeGeoMapCopyrightNotice();
46
47 void setCopyrightsZ(qreal copyrightsZ);
48
49 void setCopyrightsVisible(bool visible);
50 bool copyrightsVisible() const;
51 void anchorToBottomLeft();
52
53 void setMapSource(QDeclarativeGeoMap *mapSource);
54 QDeclarativeGeoMap *mapSource();
55
56 QString styleSheet() const;
57 void setStyleSheet(const QString &styleSheet);
58
59public Q_SLOTS:
60 void copyrightsImageChanged(const QImage &copyrightsImage);
61 void copyrightsChanged(const QString &copyrightsHtml);
62 void onCopyrightsStyleSheetChanged(const QString &styleSheet);
63
64signals:
65 void linkActivated(const QString &link);
66 void mapSourceChanged();
67 void backgroundColorChanged(const QColor &color);
68 void styleSheetChanged(const QString &styleSheet);
69 void copyrightsVisibleChanged();
70
71protected:
72 void paint(QPainter *painter) override;
73 void mousePressEvent(QMouseEvent *event) override;
74 void mouseReleaseEvent(QMouseEvent *event) override;
75 void rasterizeHtmlAndUpdate();
76 void connectMap();
77
78private:
79 void createCopyright();
80
81 QTextDocument *m_copyrightsHtml = nullptr;
82 QString m_html;
83 QImage m_copyrightsImage;
84 QString m_activeAnchor;
85 bool m_copyrightsVisible = true;
86 QPointer<QDeclarativeGeoMap> m_mapSource;
87 QColor m_backgroundColor;
88 QString m_styleSheet;
89 bool m_userDefinedStyleSheet = false;
90
91 Q_DISABLE_COPY(QDeclarativeGeoMapCopyrightNotice)
92 Q_DECLARE_PRIVATE(QDeclarativeGeoMapCopyrightNotice)
93};
94
95QT_END_NAMESPACE
96
97#endif
#define M_PI
Definition qmath.h:201