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>
This commit is contained in:
Alexandru Croitor 2020-06-12 16:00:29 +02:00
parent 306ebe03ea
commit 8a8541c3cd
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -55,8 +55,10 @@
#include <QPixmap>
#include <QUrl>
QT_BEGIN_NAMESPACE
class QNetworkReply;
class QPainter;
QT_END_NAMESPACE
class SlippyMap: public QObject
{
@ -94,3 +96,4 @@ private:
};
#endif