summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-06-12 16:00:29 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-06-12 19:30:29 +0200
commit8a8541c3cdd70e0462975a7ca66a28e9a1a8ab0d (patch)
tree171a6d5d3fee2e4b4b4e4a7666ac926f9ba9fbfa /examples
parent306ebe03ea13c6e0ac8de46e46d0859384954567 (diff)
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 <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/embedded/lightmaps/slippymap.cpp8
-rw-r--r--examples/embedded/lightmaps/slippymap.h5
2 files changed, 12 insertions, 1 deletions
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 <QPixmap>
#include <QUrl>
+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
+