BLumia / pineapple-pictures

A homebrew lightweight image viewer.
https://sourceforge.net/projects/pineapple-pictures/
MIT License
406 stars 51 forks source link

chore: use std::as_const() instead of qAsConst #108

Closed wineee closed 1 year ago

wineee commented 1 year ago

Warning: constexpr typename std::add_const<_Tp>::type& qAsConst(T&) [with T = const QList; typename std::add_const<_Tp>::type = const QList]’ is deprecated: Use std::as_const() instead. [-Wdeprecated-declarations]

BLumia commented 1 year ago

Currently this application doesn't require C++ 17 to build, The MinGW version shipped by TQtC also doesn't use C++ 17 by default, thus the Qt 5 builds are failed.

Maybe adding set(CMAKE_CXX_STANDARD 17) and set(CMAKE_CXX_STANDARD_REQUIRED ON) could be a solution but I haven't tested if that can make those existing CI build pass. If adding those could resolve the CI building issue, this can be merged. If not, then maybe this need to be merged after we completely drop Qt 5 support.

The AppVeyor Qt 6 build failure could be ignored currently, I'll try to check why that one is failed. By the way, I fixed the REUSE Compliance Check CI in last commit. If you made a change. Consider also rebase the code so the REUSE check could pas :)

BLumia commented 1 year ago

Seems it works fine. You can rebase again and the remaining Qt 6 CI will also pass. I'll merge the patch after the rebase :)