use C++ modern features like std::optional? Yes, we can assume C++17 in KF6, let's follow what Qt6 does.
about guidelines using new features : have a look at QtCreator source example that has been using modern C++ for a while, and has gathered rationales around those features