Yes the compiler was changed from GCC to MSVC2015.
As I said before, it is a matter of using an older version of Qt (5.6 works with XP), and the right compiler. And I've just discovered there is an optional MSVC2015 component for XP support.
MSVC2015 (v140_xp) 32bits build with Qt 5.6
Tested in a WinXP VM.
I expect this should work with vista too, but it is 32 bits.
I don't know what I should do for vista 64, I did not see any "vista support" package in MSVC. And it is not a Qt version issue since 39.0.0 was already using Qt 5.9.
Thank you! Yes, this version does indeed works in Vista x64 (so it should also work in native x86 too). And you are right, the reason the new versions of DT do not work in Vista is apparently not related to Qt, at least not directly. The "offender" is one function used by DwarfTherapist.exe (both 32-bot and 64-bit), which is imported from KERNEL32.DLL, and named "K32GetModuleFileNameExW". Your modified for XP DwarfTherapist.exe doesn't use that function (it uses GetModuleFileNameExW from PSAPI.DLL instead).
So in summary:
DT 39.0.0 doesn't use this function, and uses Qt v5.9.2.0 (and works for me)
DT 39.3.1 does use this function, and uses Qt v5.9.4.0 (doesn't run on Vista)
DT 39.3.1 XP doesn't use this function, and uses Qt v5.6.3.0 (and works for me)
I've found this on Microsoft's site:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683198(v=vs.85).aspx"Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetModuleFileNameEx. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll."
I can speculate, that by enabling the XP compatibility for QT5.6, the one setting quoted above was also set, to ensure that the function is called "GetModuleFileNameExW" instead of "K32GetModuleFileNameExW" (the "W" at the end means it's Unicode variant, I don't think it's important).
If you feel like it and have some time, could you maybe make the changes mentioned in MSDN article, so I would check if it is enough to run it on Vista? After all Dwarf Fortress is made with MSVC2015 (or so I've heard) and it works with older Windows versions, so it could be theoretically possible.