From 8a8541c3cdd70e0462975a7ca66a28e9a1a8ab0d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 12 Jun 2020 16:00:29 +0200 Subject: CMake: Fix lightmaps example to build in a namespaced Qt Add misisng namespace bits. The example is built by a CMake configuration. It is not built in a qmake configuration due to a missing x11 / embedded requirement. Task-number: QTBUG-84881 Change-Id: I6c53299a53e7c4e19d994ec2ae2d542667d41899 Reviewed-by: Cristian Adam Reviewed-by: Qt CI Bot --- examples/embedded/lightmaps/slippymap.cpp | 8 ++++++++ examples/embedded/lightmaps/slippymap.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'examples/embedded') diff --git a/examples/embedded/lightmaps/slippymap.cpp b/examples/embedded/lightmaps/slippymap.cpp index 66957bea18..038738c69e 100644 --- a/examples/embedded/lightmaps/slippymap.cpp +++ b/examples/embedded/lightmaps/slippymap.cpp @@ -53,10 +53,18 @@ #include "slippymap.h" #include "qmath.h" +#ifdef QT_NAMESPACE +QT_BEGIN_NAMESPACE +size_t qHash(const QT_NAMESPACE::QPoint& p) +#else size_t qHash(const QPoint& p) +#endif { return p.x() * 17 ^ p.y(); } +#ifdef QT_NAMESPACE +QT_END_NAMESPACE +#endif // tile size in pixels const int tdim = 256; diff --git a/examples/embedded/lightmaps/slippymap.h b/examples/embedded/lightmaps/slippymap.h index db95ceb684..202d00c7e4 100644 --- a/examples/embedded/lightmaps/slippymap.h +++ b/examples/embedded/lightmaps/slippymap.h @@ -55,8 +55,10 @@ #include #include +QT_BEGIN_NAMESPACE class QNetworkReply; class QPainter; +QT_END_NAMESPACE class SlippyMap: public QObject { @@ -93,4 +95,5 @@ private: QUrl m_url; }; -#endif \ No newline at end of file +#endif + -- cgit v1.2.3