mirror of https://github.com/qt/qtdatavis3d.git
Harden namespacing
When using namespaced Qt, we need to prevent symbol clashes with symbols of the same name. * namespace some globally visible classes * use hidden function as static lib initializer Task-number: QTBUG-138543 Pick-to: 6.10 Change-Id: I096064e1c4d17c172659f802459f5c1f91fa7454 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This commit is contained in:
parent
3aa9c52946
commit
6847e9b4cf
|
@ -14,17 +14,13 @@
|
|||
|
||||
#include <QtCore/qmath.h>
|
||||
|
||||
// Resources need to be explicitly initialized when building as static library
|
||||
class StaticLibInitializer
|
||||
static void initResources()
|
||||
{
|
||||
public:
|
||||
StaticLibInitializer()
|
||||
{
|
||||
Q_INIT_RESOURCE(datavisualizationshaders);
|
||||
Q_INIT_RESOURCE(datavisualizationmeshes);
|
||||
}
|
||||
};
|
||||
StaticLibInitializer staticLibInitializer;
|
||||
Q_INIT_RESOURCE(datavisualizationshaders);
|
||||
Q_INIT_RESOURCE(datavisualizationmeshes);
|
||||
}
|
||||
|
||||
Q_CONSTRUCTOR_FUNCTION(initResources)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
@ -26,10 +26,11 @@
|
|||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
class GLStateStore;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class GLStateStore;
|
||||
|
||||
class AbstractDeclarative : public QQuickItem, public AbstractDeclarativeInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -11,6 +11,8 @@ static QFile *beforeFile = 0;
|
|||
static QFile *afterFile = 0;
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
GLStateStore::GLStateStore(QOpenGLContext *context, QObject *parent) :
|
||||
QObject(parent),
|
||||
QOpenGLFunctions(context)
|
||||
|
@ -365,3 +367,5 @@ void GLStateStore::initGLDefaultState()
|
|||
m_polygonOffsetFactor = 0.0;
|
||||
m_polygonOffsetUnits = 0.0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <QtCore/QScopedArrayPointer>
|
||||
#include "enumtostringmap_p.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class GLStateStore : public QObject, protected QOpenGLFunctions
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -76,4 +78,6 @@ public:
|
|||
GLfloat m_polygonOffsetUnits;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue