Prepare application source code (C++ programming language files) for Qt6
compatibility. Implement alternative code paths where the API has changed
compared to Qt5. This unbreaks Mac OSX 12 builds with homebrew.
This change is based on work that was submitted by Dominik Sliwa
<dominik@sliwa.io>.
The warnings that are fixed are of this type:
warning: Missing reference in range-for with non trivial type (std::__cxx11::string) [-Wclazy-range-loop]
Use "using std::foo" to make the actual code itself a lot more readable.
There are some exceptions where we usually cannot do this, e.g. std::thread
often conflicts with "thread" from Qt or Boost.
Since the application metadata is set in application.c,
we should use it instead of providing it manually every
time we create a QSettings object.
As I understand it, subclassing QApplication in application.c
is only a workaround for bad Qt behavior. In the event
that it is removed, the application metadata should be moved
so that persistent storage still works.