setting up VS platfrom toolset in QtCreator

341 Views Asked by At

I have a project based on Qt which use QWebEngine. For compiling this project i've installed Visual Studio Express 2015 and have configured kits. My project is built, all is fine. But now i need to compile my project for Windows XP platform. I know, that for doing this it is needed to change toolset from v140 to v140_xp.

How can i set the toolset from qtcreator?

I tried to determine the difference in compiler options in both cases. For doing that I've created test project in Visual Studio. There i change the toolset and look at Project Properties -> C/C++ -> Command Line Options. But seems that nothing changes there.

2

There are 2 best solutions below

0
On BEST ANSWER

In VS there is an editbin utility, which could be used as follows

editbin file.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1

8
On

Qt WebEngine module does not support Windows XP targeting, so this won't work anyway. Even if it did, you'd need to build a copy of Qt that targets Windows XP - otherwise your application will target Windows XP, but not the Qt library it uses, and it won't work that way.

For completeness sake, here's how you'd do it assuming that you got Qt built targeting Windows XP:

There only two ways to do it currently without patching Qt Creator itself:

  1. Execute Qt Creator with environment variables already setup up for the XP toolset enabled for command line use. I.e. target XP from command line, and launch Qt Creator from there.

  2. Add relevant environment variable settings to the Build environment of the project in Qt Creator.

The details of environment variables needed to target Windows XP are given e.g. here.

For Windows XP portability, you should be using the semi-maintained for of the qtwebkit module. It builds and works on XP, and works with most recent Qt IIRC.

Note: It's certainly possible to target XP using WebEngine and Angle, but it requires lots of patches to current Qt. It's not an insignificant effort, and you'd definitely want to test it on the graphics cards that you intend to target - the DirectX 9 drivers on some of those machines are buggy, and while the code is correct and compiles and runs, it may not work on some systems. I'd say that it's absolutely not worth the effort.