From 013e922f862480a7b82a18e5e735892646043aad Mon Sep 17 00:00:00 2001 From: VRonin Date: Wed, 13 Oct 2021 16:52:34 +0100 Subject: [PATCH] Fix packaging for linux and build on Qt6 --- cmake/modules/package.cmake | 20 +++++++++++++------- src/CMakeLists.txt | 10 +++++----- src/private/abstractstringserialiser_p.h | 2 +- src/rolemaskproxymodel.cpp | 6 +++--- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/cmake/modules/package.cmake b/cmake/modules/package.cmake index 6184a56..0dd56dc 100644 --- a/cmake/modules/package.cmake +++ b/cmake/modules/package.cmake @@ -1,8 +1,14 @@ include("shared-Release/CPackConfig.cmake") - -set(CPACK_INSTALL_CMAKE_PROJECTS - shared-Debug ALL / - shared-Release ALL / - static-Debug ALL / - static-Release ALL / -) \ No newline at end of file +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(CPACK_INSTALL_CMAKE_PROJECTS + shared-Release ALL / + static-Release ALL / + ) +else() + set(CPACK_INSTALL_CMAKE_PROJECTS + shared-Debug ALL / + shared-Release ALL / + static-Debug ALL / + static-Release ALL / + ) +endif() \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4030d4c..38bbf71 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,11 +164,6 @@ if(modelutilities_SRCS) LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${modelutilities_PlatformDir}/lib" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${modelutilities_PlatformDir}/bin" ) - include(CMakePackageConfigHelpers) - write_basic_package_version_file("QtModelUtilitiesConfigVersion.cmake" - VERSION ${VERSION_SHORT} - COMPATIBILITY SameMajorVersion - ) install(FILES ${modelutilities_INSTALL_INCLUDE} "${CMAKE_CURRENT_BINARY_DIR}/globaldefs/modelutilities_global.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT QtModelUtilities_Development @@ -198,6 +193,11 @@ if(modelutilities_SRCS) NAMELINK_ONLY ) endif() + include(CMakePackageConfigHelpers) + write_basic_package_version_file("QtModelUtilitiesConfigVersion.cmake" + VERSION ${VERSION_SHORT} + COMPATIBILITY SameMajorVersion + ) install(EXPORT QtModelUtilitiesTargets FILE QtModelUtilitiesTargets.cmake NAMESPACE QtModelUtilities:: diff --git a/src/private/abstractstringserialiser_p.h b/src/private/abstractstringserialiser_p.h index 0292f49..3fdf69e 100644 --- a/src/private/abstractstringserialiser_p.h +++ b/src/private/abstractstringserialiser_p.h @@ -34,7 +34,7 @@ class AbstractStringSerialiserPrivate : public AbstractModelSerialiserPrivate QVariant loadVariant(int type, const QString &val) const; QString saveVariant(const QVariant &val) const; static int guessDecimals(double val); - static QString guessDecimalsString(double val, QLocale *loca = Q_NULLPTR); + static QString guessDecimalsString(double val, QLocale *loca = nullptr); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QTextCodec *m_textCodec; #endif diff --git a/src/rolemaskproxymodel.cpp b/src/rolemaskproxymodel.cpp index 276fdaa..8db3ee7 100644 --- a/src/rolemaskproxymodel.cpp +++ b/src/rolemaskproxymodel.cpp @@ -778,13 +778,13 @@ void RoleMaskProxyModel::multiData(const QModelIndex &index, QModelRoleDataSpan Q_D(const RoleMaskProxyModel); const QModelIndex sourceIndex = mapToSource(index); sourceModel()->multiData(sourceIndex, roleDataSpan); - const RolesContainer *idxData = d->dataForIndex(sourceIndex); + const FlaggedRolesContainer *idxData = d->dataForIndex(sourceIndex); for (QModelRoleData &roleData : roleDataSpan) { int role = roleData.role(); if (d->m_mergeDisplayEdit && role == Qt::EditRole) role = Qt::DisplayRole; - const auto roleIter = idxData->constFind(role); - if (roleIter != idxData->constEnd()) + const auto roleIter = idxData->roles.constFind(role); + if (roleIter != idxData->roles.constEnd()) roleData.setData(roleIter.value()); else if (!d->m_transparentIfEmpty && d->m_maskedRoles.contains(role)) roleData.setData(d->m_defaultValues.value(role, QVariant()));