summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-12-11 14:57:11 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-01-15 09:06:27 +0000
commit2b6020a59ef503eeadabc532782f5e9e795fcf3f (patch)
tree2163c77dd21fef3ad21c650c3e68da1a3dea4a7e /src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
parent7b8ab37beaafbe27c258a6d80d1914f982dcc9e1 (diff)
downloadqtlocation-2b6020a59ef503eeadabc532782f5e9e795fcf3f.tar.gz
Fix performance issue with copyright notice
Skip evaluating copyrights when the notice is not visible. The implication of this patch is that copyright information won't be up to date or even available unless there is an "attached" copyright notice that has the visible property set to true. Task-number: QTBUG-64880 Change-Id: I3750b61913becb0cbf31273ad9a76ae1a2b6a393 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.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
index 0d7f7a20..9b28299f 100644
--- a/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomapcopyrightsnotice_p.h
@@ -52,13 +52,14 @@
#include <QtLocation/private/qlocationglobal_p.h>
#include <QtGui/QImage>
+#include <QPointer>
#include <QtQuick/QQuickPaintedItem>
QT_BEGIN_NAMESPACE
class QTextDocument;
class QDeclarativeGeoMap;
-
+class QDeclarativeGeoMapCopyrightNoticePrivate;
class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapCopyrightNotice : public QQuickPaintedItem
{
Q_OBJECT
@@ -72,6 +73,7 @@ public:
void setCopyrightsZ(int copyrightsZ);
void setCopyrightsVisible(bool visible);
+ bool copyrightsVisible() const;
void anchorToBottomLeft();
void setMapSource(QDeclarativeGeoMap *mapSource);
@@ -90,6 +92,7 @@ signals:
void mapSourceChanged();
void backgroundColorChanged(const QColor &color);
void styleSheetChanged(const QString &styleSheet);
+ void copyrightsVisibleChanged();
protected:
void paint(QPainter *painter) Q_DECL_OVERRIDE;
@@ -106,10 +109,13 @@ private:
QImage m_copyrightsImage;
QString m_activeAnchor;
bool m_copyrightsVisible;
- QDeclarativeGeoMap *m_mapSource;
+ QPointer<QDeclarativeGeoMap> m_mapSource;
QColor m_backgroundColor;
QString m_styleSheet;
bool m_userDefinedStyleSheet;
+
+ Q_DISABLE_COPY(QDeclarativeGeoMapCopyrightNotice)
+ Q_DECLARE_PRIVATE(QDeclarativeGeoMapCopyrightNotice)
};
QT_END_NAMESPACE