summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-31 03:03:41 +0200
committerAlex Blasche <alexander.blasche@qt.io>2020-04-02 08:20:37 +0200
commitb06a07cf9fd474e11fbe467047e5fe0322b677f0 (patch)
treeba8b1dd84c3d263b27a1865fff84a659b5273091 /src/location/declarativemaps/qdeclarativegeomapitembase_p.h
parent4cfed13377ababcfaa7dacb055bcd3dd0f2cf7d4 (diff)
parent29816a3aaa3f368422a3b19983add62673bb6960 (diff)
downloadqtlocation-b06a07cf9fd474e11fbe467047e5fe0322b677f0.tar.gz
Merge 5.15 to dev and fix resulting compile issues
Conflicts: src/imports/location/location.cpp The change fixes the bare minimum of what needs to be done to compile and run. This includes the following issues: 1. Fix build failures as a result of QMetaType changes in qtbase moc now stores the QMetaType of properties as a result of 46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires full type information about the property type inside the moc generated source file. Many of the property types were forward-declared, and this resulted in build errors like: "invalid application of 'sizeof' to an incomplete type 'QDeclarativeGeoMap'" 2. Adopts QtQML API changes. A private QJSValue ctor was removed. The "replacement" is QJSValuePrivate::fromReturnedValue(..). 3. The mapboxgl 3rdparty backend does not compile at this point in time and seems unmaintained. For the time being, the mapboxgl backend is disabled in the interest of keeping qtlocation closer to dev HEAD of other Qt modules. Change-Id: I756e1c2effb29eaaf96a61a28c1c17338774b77c
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomapitembase_p.h')
-rw-r--r--src/location/declarativemaps/qdeclarativegeomapitembase_p.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
index 38a118e5..61a67f59 100644
--- a/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapitembase_p.h
@@ -85,6 +85,8 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapItemBase : public QQuickItem
Q_PROPERTY(QGeoShape geoShape READ geoShape WRITE setGeoShape STORED false )
Q_PROPERTY(bool autoFadeIn READ autoFadeIn WRITE setAutoFadeIn REVISION 14)
+ Q_PROPERTY(int lodThreshold READ lodThreshold WRITE setLodThreshold NOTIFY lodThresholdChanged REVISION 15)
+
public:
explicit QDeclarativeGeoMapItemBase(QQuickItem *parent = 0);
virtual ~QDeclarativeGeoMapItemBase();
@@ -92,14 +94,18 @@ public:
virtual void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map);
virtual void setPositionOnMap(const QGeoCoordinate &coordinate, const QPointF &offset);
- QDeclarativeGeoMap *quickMap() { return quickMap_; }
- QGeoMap *map() { return map_; }
+ QDeclarativeGeoMap *quickMap() const { return quickMap_; }
+ QGeoMap *map() const { return map_; }
virtual const QGeoShape &geoShape() const = 0;
virtual void setGeoShape(const QGeoShape &shape) = 0;
bool autoFadeIn() const;
void setAutoFadeIn(bool fadeIn);
+ int lodThreshold() const;
+ void setLodThreshold(int lt);
+ unsigned int zoomForLOD(int zoom) const;
+
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
virtual QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *);
@@ -108,10 +114,28 @@ public:
void setParentGroup(QDeclarativeGeoMapItemGroup &parentGroup);
+ template <typename T = QObject>
+
+ QList<T*> quickChildren() const
+ {
+ QList<T*> res;
+ QObjectList kids = children();
+ QList<QQuickItem *> quickKids = childItems();
+ for (int i = 0; i < quickKids.count(); ++i)
+ kids.append(quickKids.at(i));
+ for (auto kid : qAsConst(kids)) {
+ auto val = qobject_cast<T*>(kid);
+ if (val)
+ res.push_back(val);
+ }
+ return res;
+ }
+
Q_SIGNALS:
void mapItemOpacityChanged();
Q_REVISION(12) void addTransitionFinished();
Q_REVISION(12) void removeTransitionFinished();
+ void lodThresholdChanged();
protected Q_SLOTS:
virtual void afterChildrenChanged();
@@ -122,6 +146,7 @@ protected:
float zoomLevelOpacity() const;
bool childMouseEventFilter(QQuickItem *item, QEvent *event);
bool isPolishScheduled() const;
+ virtual void setMaterialDirty();
QGeoMap::ItemType m_itemType = QGeoMap::NoItem;
@@ -140,6 +165,7 @@ private:
QScopedPointer<QDeclarativeGeoMapItemTransitionManager> m_transitionManager;
bool m_autoFadeIn = true;
+ int m_lodThreshold = 0;
friend class QDeclarativeGeoMap;
friend class QDeclarativeGeoMapItemView;