Skip to content

Commit

Permalink
Update to Qt 6.8 (#5880)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored Dec 10, 2024
1 parent 85ad991 commit 0535501
Show file tree
Hide file tree
Showing 22 changed files with 82 additions and 8,960 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMake settings
cmake_minimum_required(VERSION 3.19)

set(VCPKG_TAG 9e0815331a5072a6851348482338ca2e7593947d)
set(VCPKG_TAG ca5f8ea7937cd83c332549d896324f851e9f40e7)

set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/src/qml/imports CACHE PATH "QML import path for Qt Creator to detect custom modules properly")

Expand Down
2 changes: 1 addition & 1 deletion cmake/Package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if(QT_MOC_EXECUTABLE)
get_filename_component(_qt_bin_dir ${QT_MOC_EXECUTABLE} DIRECTORY)
endif()
find_program(LINUXDEPLOY_EXECUTABLE linuxdeploy linuxdeploy-x86_64.AppImage)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_HOST_LIBEXECS}" NO_DEFAULT_PATH)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${VCPKG_INSTALLED_DIR}/arm64-osx/tools/Qt6/bin" NO_DEFAULT_PATH)
find_program(ANDROIDDEPLOYQT_EXECUTABLE androiddeployqt HINTS "${QT_HOST_PATH}/tools/Qt6/bin")

set(CPACK_GENERATOR)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
if(ANDROID_ABI)
set(ANDROID_BUILD_TOOLS_VERSION "34.0.0" CACHE STRING "Android build-tools version")
set(ANDROID_TARGET_PLATFORM 34 CACHE INT "Target Android platform SDK version")
set(ANDROID_PLATFORM 23 CACHE INT "Minimum Android platform SDK version")
set(ANDROID_PLATFORM_INT 23 CACHE INT "Minimum Android platform SDK version") # Used in build.gradle.in
set(ANDROID_PLATFORM 26 CACHE INT "Minimum Android platform SDK version")
set(ANDROID_PLATFORM_INT 26 CACHE INT "Minimum Android platform SDK version") # Used in build.gradle.in
set(ANDROID_CPP_FEATURES "rtti exceptions")
endif()
2 changes: 1 addition & 1 deletion cmake/VcpkgToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(NOT VCPKG_TAG STREQUAL VCPKG_INSTALLED_VERSION)
message(STATUS "Updating vcpkg")
include(FetchContent)
FetchContent_Declare(vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg.git
GIT_REPOSITORY https://github.com/Neumann-A/vcpkg.git
GIT_TAG ${VCPKG_TAG}
)
FetchContent_MakeAvailable(vcpkg)
Expand Down
4 changes: 3 additions & 1 deletion cmake/qgis-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ if(TRUE) # Should possibly have a "static only" check
target_link_libraries(QGIS::Core INTERFACE PkgConfig::freexl)
_qgis_core_add_dependency(Qt6Keychain::Qt6Keychain Qt6Keychain)

find_package(Qt6 COMPONENTS Core Gui Network Xml Svg Concurrent Sql Positioning Core5Compat)

find_package(Qt6 COMPONENTS Core Gui Network Xml Svg Concurrent Sql Positioning Core5Compat Multimedia)
target_link_libraries(QGIS::Core INTERFACE
Qt::Gui
Qt::Core
Expand All @@ -152,6 +153,7 @@ if(TRUE) # Should possibly have a "static only" check
Qt::Sql
Qt::Positioning
Qt::Core5Compat
Qt::Multimedia
)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
find_package(Qt6 COMPONENTS SerialPort)
Expand Down
20 changes: 20 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,26 @@ if(TARGET Qt::PrintSupport)
target_link_libraries(qfield_core PUBLIC Qt::PrintSupport)
endif()

if(MSVC)
find_package(FFMPEG REQUIRED)
find_library(AVCODEC_LIBRARY avcodec)
find_library(AVDEVICE_LIBRARY avdevice)
find_library(AVFORMAT_LIBRARY avformat)
find_library(AVUTIL_LIBRARY avutil)
find_library(SWRESAMPLE_LIBRARY swresample)
find_library(SWSCALE_LIBRARY swscale)
find_library(OPENH264_LIBRARY openh264)
target_link_libraries(
qfield_core
PUBLIC ${AVCODEC_LIBRARY}
${AVDEVICE_LIBRARY}
${AVFORMAT_LIBRARY}
${AVUTIL_LIBRARY}
${SWRESAMPLE_LIBRARY}
${SWSCALE_LIBRARY}
${OPENH264_LIBRARY})
endif()

install(FILES ${QFIELD_CORE_HDRS} DESTINATION ${QFIELD_INCLUDE_DIR})
install(
TARGETS qfield_core
Expand Down
3 changes: 2 additions & 1 deletion src/core/positioning/egenioussreceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <QHostAddress>
#include <QJsonDocument>
#include <QJsonValue>
#include <QTimeZone>

EgenioussReceiver::EgenioussReceiver( QObject *parent )
: AbstractGnssReceiver( parent ), mTcpSocket( new QTcpSocket() )
Expand Down Expand Up @@ -112,7 +113,7 @@ void EgenioussReceiver::onReadyRead()
0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::quiet_NaN(),
QDateTime::fromMSecsSinceEpoch( mPayload.value( "utc" ).toDouble() / 1e6, Qt::UTC ),
QDateTime::fromMSecsSinceEpoch( mPayload.value( "utc" ).toDouble() / 1e6, QTimeZone( QTimeZone::Initialization::UTC ) ),
QChar(),
0,
1 );
Expand Down
4 changes: 2 additions & 2 deletions src/core/projectinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ void ProjectInfo::saveTemporalState()

mSettings.beginGroup( QStringLiteral( "/qgis/projectInfo/%1" ).arg( mFilePath ) );
mSettings.setValue( QStringLiteral( "isTemporal" ), mMapSettings->isTemporal() );
mSettings.setValue( QStringLiteral( "StartDateTime" ), mMapSettings->temporalBegin().toTimeSpec( Qt::LocalTime ).toString( Qt::ISODateWithMs ) );
mSettings.setValue( QStringLiteral( "EndDateTime" ), mMapSettings->temporalEnd().toTimeSpec( Qt::LocalTime ).toString( Qt::ISODateWithMs ) );
mSettings.setValue( QStringLiteral( "StartDateTime" ), mMapSettings->temporalBegin().toTimeZone( QTimeZone( QTimeZone::Initialization::LocalTime ) ).toString( Qt::ISODateWithMs ) );
mSettings.setValue( QStringLiteral( "EndDateTime" ), mMapSettings->temporalEnd().toTimeZone( QTimeZone( QTimeZone::Initialization::LocalTime ) ).toString( Qt::ISODateWithMs ) );
mSettings.endGroup();
}

Expand Down
2 changes: 1 addition & 1 deletion src/qml/FeatureForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Page {
delegate: TabButton {
id: tabButton
property bool isCurrentIndex: index == tabRow.currentIndex
objectName: "tabRowdDelegate_" + index
text: Name
topPadding: 0
bottomPadding: 0
leftPadding: !ConstraintHardValid || !ConstraintSoftValid ? 22 : 8
rightPadding: 8
width: contentItem.width + leftPadding + rightPadding
height: 48
objectName: "tabRowdDelegate_" + index

onClicked: {
tabRow.currentIndex = index;
Expand Down
8 changes: 3 additions & 5 deletions test/test_qml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,10 @@ class Setup : public QObject

QgisMobileapp::initDeclarative( engine );

QString mPath = mDataDir + "/test_bees.qgz";
QgsProject::instance()->read( mDataDir + "/test_bees.qgz", Qgis::ProjectReadFlag::DontLoadProjectStyles | Qgis::ProjectReadFlag::DontLoad3DViews | Qgis::ProjectReadFlag::DontLoadLayouts );

QgsProject::instance()->read( mPath, Qgis::ProjectReadFlag::DontLoadProjectStyles | Qgis::ProjectReadFlag::DontLoad3DViews | Qgis::ProjectReadFlag::DontLoadLayouts );

engine->rootContext()->setContextProperty( "ppi", 96 );
engine->rootContext()->setContextProperty( "qgisProject", QgsProject::instance() );
engine->rootContext()->setContextProperty( QStringLiteral( "ppi" ), 96 );
engine->rootContext()->setContextProperty( QStringLiteral( "qgisProject" ), QgsProject::instance() );
engine->rootContext()->setContextProperty( QStringLiteral( "dataDir" ), mDataDir );

QgsExifTools mExifTools;
Expand Down
13 changes: 13 additions & 0 deletions vcpkg/ports/qtmultimedia/ffmpeg-compile-def.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/plugins/multimedia/ffmpeg/CMakeLists.txt b/src/plugins/multimedia/ffmpeg/CMakeLists.txt
index 77c459a..af5229e 100644
--- a/src/plugins/multimedia/ffmpeg/CMakeLists.txt
+++ b/src/plugins/multimedia/ffmpeg/CMakeLists.txt
@@ -273,7 +273,7 @@ if(BUILD_SHARED_LIBS)
else()
foreach(ffmpeg_lib IN LISTS ffmpeg_libs)
qt_internal_add_target_include_dirs(QFFmpegMediaPlugin ${ffmpeg_lib})
- target_include_directories(QFFmpegMediaPlugin PRIVATE
+ target_compile_definitions(QFFmpegMediaPlugin PRIVATE
"$<TARGET_PROPERTY:${ffmpeg_lib},INTERFACE_COMPILE_DEFINITIONS>")
endforeach()
endif()
4 changes: 4 additions & 0 deletions vcpkg/ports/qtmultimedia/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(${PORT}_PATCHES
fix_avfoundation_target.patch
remove-static-ssl-stub.patch
private_libs.patch
ffmpeg-compile-def.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -21,10 +22,12 @@ INVERTED_FEATURES
"vaapi" CMAKE_DISABLE_FIND_PACKAGE_VAAPI # not in vpckg
)

set(unused "")
if("gstreamer" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS "-DINPUT_gstreamer='yes'")
else()
list(APPEND FEATURE_OPTIONS "-DINPUT_gstreamer='no'")
list(APPEND unused INPUT_gstreamer_gl INPUT_gstreamer_photography)
endif()
list(APPEND FEATURE_OPTIONS "-DINPUT_gstreamer_gl='no'")
list(APPEND FEATURE_OPTIONS "-DINPUT_gstreamer_photography='no'")
Expand Down Expand Up @@ -63,6 +66,7 @@ qt_install_submodule(PATCHES ${${PORT}_PATCHES}
-DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON
CONFIGURE_OPTIONS_RELEASE
CONFIGURE_OPTIONS_DEBUG
CONFIGURE_OPTIONS_MAYBE_UNUSED ${unused}
)

if("gstreamer" IN_LIST FEATURES AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down
42 changes: 21 additions & 21 deletions vcpkg/ports/qtmultimedia/static_find_modules.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ index 47d8769..46a5c9b 100644
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIR})
list(APPEND FFMPEG_LIBRARY_DIRS ${${_component}_LIBRARY_DIR})
@@ -306,18 +306,19 @@ endfunction()
string(TOLOWER ${_component} _lowerComponent)
if (NOT TARGET FFmpeg::${_lowerComponent})
- add_library(FFmpeg::${_lowerComponent} INTERFACE IMPORTED)
+ add_library(FFmpeg::${_lowerComponent} UNKNOWN IMPORTED)
set_target_properties(FFmpeg::${_lowerComponent} PROPERTIES
INTERFACE_COMPILE_OPTIONS "${${_component}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES ${${_component}_INCLUDE_DIR}
- INTERFACE_LINK_LIBRARIES "${${_component}_LIBRARY_NAME}"
- INTERFACE_LINK_DIRECTORIES "${${_component}_LIBRARY_DIR}"
+ IMPORTED_LOCATION "${${_component}_LIBRARY}"
)
string(TOLOWER ${_component} _lowerComponent)
if (NOT TARGET FFmpeg::${_lowerComponent})
- add_library(FFmpeg::${_lowerComponent} INTERFACE IMPORTED)
+ add_library(FFmpeg::${_lowerComponent} UNKNOWN IMPORTED)
set_target_properties(FFmpeg::${_lowerComponent} PROPERTIES
INTERFACE_COMPILE_OPTIONS "${${_component}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES ${${_component}_INCLUDE_DIR}
- INTERFACE_LINK_LIBRARIES "${${_component}_LIBRARY_NAME}"
- INTERFACE_LINK_DIRECTORIES "${${_component}_LIBRARY_DIR}"
+ IMPORTED_LOCATION "${${_component}_LIBRARY}"
)

__ffmpeg_internal_set_dependencies(${_component})
- target_link_libraries(FFmpeg::${_lowerComponent} INTERFACE "${${_component}_LIBRARY_NAME}")
+ if(WIN32 AND _lowerComponent STREQUAL "avutil")
+ target_link_libraries(FFmpeg::${_lowerComponent} INTERFACE "Bcrypt.lib")
+ endif()
if (UNIX AND NOT APPLE)
target_link_options(FFmpeg::${_lowerComponent} INTERFACE "-Wl,--exclude-libs=lib${_lowerComponent}")
endif ()
endif()
__ffmpeg_internal_set_dependencies(${_component})
- target_link_libraries(FFmpeg::${_lowerComponent} INTERFACE "${${_component}_LIBRARY_NAME}")
+ if(WIN32 AND _lowerComponent STREQUAL "avutil")
+ target_link_libraries(FFmpeg::${_lowerComponent} INTERFACE "Bcrypt.lib")
+ endif()
if (UNIX AND NOT APPLE)
target_link_options(FFmpeg::${_lowerComponent} INTERFACE "-Wl,--exclude-libs=lib${_lowerComponent}")
endif ()
endif()
endif()
endforeach ()
endforeach ()
@@ -361,14 +364,18 @@ if (shared_libs_desired AND NOT FFMPEG_SHARED_COMPONENTS)
endif()

Expand Down
6 changes: 1 addition & 5 deletions vcpkg/ports/qtmultimedia/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qtmultimedia",
"version": "6.7.3",
"version": "6.8.1",
"description": "Qt Multimedia is an add-on module that provides a rich set of QML types and C++ classes to handle multimedia content.",
"homepage": "https://www.qt.io/",
"license": null,
Expand All @@ -20,10 +20,6 @@
}
],
"default-features": [
{
"name": "gstreamer",
"platform": "linux"
},
"widgets"
],
"features": {
Expand Down
Loading

1 comment on commit 0535501

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.