mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Qt6: first steps towards map support
There is an initial build of the C++ classes that seems to work, but the QML integration is still missing. Still, progress is being made. Unfortunately with Qt6 we can't forward declare the MapLocationModel class (one of the operators needs to be able to determine the size of the class), so we need to include the header file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2241a28499
commit
ea961edec8
2 changed files with 21 additions and 1 deletions
|
@ -192,6 +192,26 @@ if(QT_VERSION_MAJOR STREQUAL "6")
|
|||
# QtWebKit doesn't work with Qt6, so no printing, no manual
|
||||
set(NO_PRINTING ON)
|
||||
set(NO_USERMANUAL ON)
|
||||
|
||||
# as of Qt 6.3 by default QtLocation isn't included, but one can
|
||||
# build the module from source; so let's look if the user has installed
|
||||
# it (or if a newer version is out that includes it, anyway)
|
||||
find_package(Qt6 COMPONENTS Location)
|
||||
if(Qt6Location_FOUND)
|
||||
message(STATUS "Found Qt6Location")
|
||||
LIST(APPEND QT_EXTRA_COMPONENTS Location)
|
||||
add_definitions(-DMAP_SUPPORT)
|
||||
set(MAPSUPPORT ON)
|
||||
|
||||
# at least on macOS something goes sideways and we fail to load the
|
||||
# QML files with a weird error about Qml.WorkerScript missing
|
||||
# linking Subsurface against that component appears enough to hack
|
||||
# around that, but that feels... wrong
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
find_package(Qt6 COMPONENTS QmlWorkerScript)
|
||||
LIST(APPEND SUBSURFACE_LINK_LIBRARIES Qt6::QmlWorkerScript)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# as mentioned above, since some variables appear to fail to populate
|
||||
# on some platforms, simply run this again the 'old' way
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Q_IMPORT_PLUGIN(QGeoServiceProviderFactoryGooglemaps)
|
||||
#endif
|
||||
|
||||
class MapLocationModel;
|
||||
#include "qt-models/maplocationmodel.h"
|
||||
class MapLocation;
|
||||
struct dive_site;
|
||||
|
||||
|
|
Loading…
Reference in a new issue