"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
- Shiboken headers need to be included first to get MAJOR/MINOR version
flags. Without them the code would still compile, but fail the version
check a few lines below assuming Shiboken is always older than 5.12
- Fix typo in cast when HAVE_SHIBOKEN_TYPE_FOR_TYPENAME is defined and
remove the conditional: we have to assume typeForTypeName() always
results in a valid name, as for the other implementations. There's no
error handling of any kind in callers.
This fixes the build on debian unstable with shiboken 5.15.
When qt_wrapInstance fails it returns Py::Object with internal
pointer set to null. Make PythonWrapper::from* methods raise
exception when this happens to be consistent with PySide code path.
Wrapping QAction through QObject does not work as QAction class
is a part of QtGui not QtCore, so Py::Object with internal
pointer being null is returned causing a crash later.
Therefore implement fromQAction conversion method.
Foreign Python objects needs to be passed as Py::Object().
Py::asObject() is stealing reference and object might be garbage
collected even before dereferenced. Problem didn't show in the
original code because methods Py::asObject() was used in were
never called.
Fixes: 26babf4d3674 (Gui: Consolidate Python -> Qt class conversion)