Update MSVC compiler options and CMake configuration for 1.5.1#459
Conversation
- Disable strict MSVC compliance mode to prevent build errors caused by standard library ('stdext') changes in newer MSVC compilers with older Qt headers.
Replace MSVC compliance mode disabling with a definition to allow compiler and STL version mismatch.
Updated CMakeLists.txt to modify compiler options for MSVC.
Removed MSVC specific flags for permissive mode.
|
|
@j2doll what do you think about dropping qmake and Qt5 support? It's pretty much EOL |
Thank you for reporting. I agree with that. Qt5 seems to have ended. 💀
|
| Qt Version | Minimum C++ Standard | Key Changes & Standard Support |
|---|---|---|
| Qt 6.0 ~ 6.2 LTS | C++17 | C++17 became the strict baseline for Qt 6. Started adding partial support for C++20 features (e.g., designated initializers). |
| Qt 6.3 ~ 6.5 LTS | C++17 | Enhanced integration with std::chrono and expanded C++20-related macros and helper functions. |
| Qt 6.6 ~ 6.7 | C++17 | Improved compatibility with C++20 containers. Active compiler testing for C++23 compatibility. |
| Qt 6.8 LTS ~ 6.9+ | C++17 |
(C++20 for certain modules) | Qt WebEngine and other Chromium-based modules now strictly require a C++20 compiler. Deeper integration with C++20/C++23 standard library features. |
Key Highlights & Considerations
- Framework Baseline: You must use a compiler that supports at least C++17 to build or develop with any Qt 6 version (upgraded from the C++11 baseline in Qt 5).
- The Qt WebEngine Exception: Starting from Qt 6.8 LTS, the Qt WebEngine module requires a C++20 compiler due to upstream Chromium updates. If your project utilizes WebEngine, your build environment must be set to C++20.
- Using C++20/C++23 in Your Code: Even though Qt 6 is built on C++17, you can freely set
CMAKE_CXX_STANDARDto20or23in your own project'sCMakeLists.txt. Qt 6 fully supports this, and newer minor versions (especially Qt 6.5+) offer much smoother type conversions between Qt types and modern C++ types (likeQDateTimeandstd::chrono).




This pull request updates the QXlsx library to improve C++ standard handling, enhance MSVC compatibility, and clean up some legacy code and configuration. The most important changes are grouped below:
Build System and C++ Standard Improvements:
1.5.0to1.5.1inCMakeLists.txtto reflect the new release.QXlsx.pri: now sets C++11 for Qt 5 and C++17 for Qt 6, with messages for clarity.MSVC and Cross-Platform Compatibility:
xlsxglobal.hfor MSVC to definemake_checked_array_iteratorand ensure compatibility with MSVC's standard library extensions./permissivecompile flag inCMakeLists.txtto override/permissive-and avoid standards compliance issues.Code and Configuration Cleanup:
mainwindow.cppas it is now managed in the build system.xlsxreadsaxfromQXlsx.pro.