[Qt] Remove QtQuick dependency from the low-level API
Not really needed.
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
b35ca2099a
commit
1f3424fafa
1
platform/qt/include/QQuickMapboxGL
Normal file
1
platform/qt/include/QQuickMapboxGL
Normal file
@@ -0,0 +1 @@
|
||||
#include "qquickmapboxgl.hpp"
|
||||
1
platform/qt/include/QQuickMapboxGLMapParameter
Normal file
1
platform/qt/include/QQuickMapboxGLMapParameter
Normal file
@@ -0,0 +1 @@
|
||||
#include "qquickmapboxglmapparameter.hpp"
|
||||
@@ -51,7 +51,6 @@ typedef void (*CustomLayerRenderFunction)(void* context, const CustomLayerRender
|
||||
typedef void (*CustomLayerDeinitializeFunction)(void* context);
|
||||
|
||||
Q_DECL_EXPORT void initializeGLExtensions();
|
||||
Q_DECL_EXPORT void registerTypes();
|
||||
|
||||
} // namespace QMapbox
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <QMapbox>
|
||||
#include <QQuickMapboxGL>
|
||||
#include <QQuickMapboxGLMapParameter>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QIcon>
|
||||
@@ -13,9 +14,8 @@ int main(int argc, char *argv[])
|
||||
app.setWindowIcon(QIcon(":icon.png"));
|
||||
#endif
|
||||
|
||||
// Exposes the QQuickMapboxGL module so we
|
||||
// can do `import QQuickMapboxGL 1.0`.
|
||||
QMapbox::registerTypes();
|
||||
qmlRegisterType<QQuickMapboxGL>("QQuickMapboxGL", 1, 0, "MapboxMap");
|
||||
qmlRegisterType<QQuickMapboxGLMapParameter>("QQuickMapboxGL", 1, 0, "MapParameter");
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
|
||||
@@ -10,18 +10,16 @@ find_package(Qt5Sql REQUIRED)
|
||||
set(MBGL_QT_LIBRARIES
|
||||
PRIVATE Qt5::Core
|
||||
PRIVATE Qt5::Gui
|
||||
PRIVATE Qt5::Location
|
||||
PRIVATE Qt5::Network
|
||||
PRIVATE Qt5::OpenGL
|
||||
PRIVATE Qt5::Quick
|
||||
PRIVATE Qt5::Sql
|
||||
)
|
||||
|
||||
target_sources(qmapboxgl
|
||||
PRIVATE platform/qt/include/qquickmapboxgl.hpp
|
||||
PRIVATE platform/qt/include/qquickmapboxglmapparameter.hpp
|
||||
PRIVATE platform/qt/src/qquickmapboxgl.cpp
|
||||
PRIVATE platform/qt/src/qquickmapboxgl.hpp
|
||||
PRIVATE platform/qt/src/qquickmapboxglmapparameter.cpp
|
||||
PRIVATE platform/qt/src/qquickmapboxglmapparameter.hpp
|
||||
PRIVATE platform/qt/src/qquickmapboxglrenderer.cpp
|
||||
PRIVATE platform/qt/src/qquickmapboxglrenderer.hpp
|
||||
)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include <mbgl/util/traits.hpp>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include "qquickmapboxgl.hpp"
|
||||
#include "qquickmapboxglmapparameter.hpp"
|
||||
#include <QOpenGLContext>
|
||||
#else
|
||||
#include <QGLContext>
|
||||
@@ -57,12 +55,4 @@ Q_DECL_EXPORT void initializeGLExtensions()
|
||||
});
|
||||
}
|
||||
|
||||
Q_DECL_EXPORT void registerTypes()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
qmlRegisterType<QQuickMapboxGL>("QQuickMapboxGL", 1, 0, "MapboxMap");
|
||||
qmlRegisterType<QQuickMapboxGLMapParameter>("QQuickMapboxGL", 1, 0, "MapParameter");
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user