diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-23 17:37:59 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-01-30 09:29:15 +0000 |
commit | 1d867cd2e4ab1560a22294f97e03a779200ef4db (patch) | |
tree | e7f54092f522d6a9c020afdcf9b18f3be89aef2d /src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h | |
parent | 0a5dd29d4b02a192ec7e691cf88f623152ce100b (diff) | |
download | qtlocation-1d867cd2e4ab1560a22294f97e03a779200ef4db.tar.gz |
Expose QDeclarativeGeoMapCopyrightNotice in QML
This change allows the user to create a separate
MapCopyrightsNotice, and source the notice from a Map
element.
The purpose is to allow the user to stack multiple Map
elements and have a cleanly arranged set of copyright
notices on top of this stack.
To do so it is now possible to setCopyrightsVisible(false)
on all the Map elements, then declare one notice per map,
and arrange it appropriately on top of the stack.
As for any other QQuickItem, a MapCopyrightsNotice cannot
be declared inside a Map {} element, and if done so, a
a warning will be produced.
Change-Id: Ie38dec40cf25f0c44d1da39fd74469944eb79eba
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h index 1aeef7c1..551bf411 100644 --- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h +++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h @@ -57,18 +57,24 @@ QT_BEGIN_NAMESPACE class QTextDocument; +class QDeclarativeGeoMap; class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapCopyrightNotice : public QQuickPaintedItem { Q_OBJECT + Q_PROPERTY(QDeclarativeGeoMap *mapSource READ mapSource WRITE setMapSource NOTIFY mapSourceChanged) public: - explicit QDeclarativeGeoMapCopyrightNotice(QQuickItem *parent); + QDeclarativeGeoMapCopyrightNotice(QQuickItem *parent = Q_NULLPTR); ~QDeclarativeGeoMapCopyrightNotice(); void setCopyrightsZ(int copyrightsZ); void setCopyrightsVisible(bool visible); + void anchorToBottomLeft(); + + void setMapSource(QDeclarativeGeoMap *mapSource); + QDeclarativeGeoMap *mapSource(); public Q_SLOTS: void copyrightsChanged(const QImage ©rightsImage); @@ -76,6 +82,7 @@ public Q_SLOTS: signals: void linkActivated(const QString &link); + void mapSourceChanged(); protected: void paint(QPainter *painter) Q_DECL_OVERRIDE; @@ -87,6 +94,7 @@ private: QImage m_copyrightsImage; QString m_activeAnchor; bool m_copyrightsVisible; + QDeclarativeGeoMap *m_mapSource; }; QT_END_NAMESPACE |