How to use Visual Studio 2017 with Qt to develop graphical applications?

I've searched everywhere but I can't find support for the latest version of Visual Studio.

Is there a way to get around this?

+12


source to share


1 answer


Qt 5.9.1 and later are pre-built for VS 2017 64 bit. You can download it from the official Qt web page . If you need 32 bits, I apologize for having to compile it manually (good luck, this is usually not an easy or straightforward process). See updates below.

Also, you need VS Tools. You can download the latest version for VS 2017 here (the official downloads page hasn't been updated yet for this). There is no stable release for VS 2017 (see Update below), but the latest (albeit slightly outdated) development build fixes major integration issues. You can download it here .

Finally, just take a look at the official documentation to quickly learn how to use it. Basically:

  • Configure your version of Qt with VS Tools: In VS go to Qt VS Tools> Qt Options and add your installation.
  • Now you can create a new project. The extension will add a new collection of templates for Visual C ++ called Qt where you will probably use a Qt GUI application.
  • The rest is standard Qt programming. VS Tools takes full responsibility for compiling .ui files (interface design), moving required files, translations (if used), etc.



UPDATE: As mentioned in this post from MSDN , binaries generated by usign VS 2015 are compatible with VS 2017. So Qt compilations for 2015 (32 and 64 bit) should work in this case as well.

UPDATE (2018-9-13): Two months ago we were using a 32-bit build of VS 2015 in VS 2017 (including the latest 15.8.4 update). In this sense, no problems have been found yet.

UPDATE (2018-12-10): Qt 5.12.0 (LTS) comes with pre-compiled binaries for VS 2017 32 and 64 bit.




UPDATE: Last February the first official release of VS Tools for VS 2017 was released. You can read more about this on the Qt blog .

+16


source







All Articles