32

We have large project that used .NET Framework for showing forms/windows. Recently I decided to deprecate CLR dependency and move to Qt.

While learning Qt, we've migrated from Visual studio 2013 to 2015 and then I noticed that there is no qt support for MSVC 14 version which vs2015 use.

Additionally, Qt vs addin was not working jn visual studio express/community edition we use. Is there any chance for me to use Qt and qt addin in our projects?

Searching web did not help, and it looks like no one use Qt with latest Visual Studio?

peterh
  • 11,875
  • 18
  • 85
  • 108
Croll
  • 3,631
  • 6
  • 30
  • 63
  • It's a little unclear what you're asking. Are you running into an issue building Qt, or are you looking for a pre-built package for VS 2015? – MrEricSir Oct 01 '15 at 19:33
  • 2
    @MrEricSir As a beginner, i strongly avoid attempting to build qt from source. If there are no alternatives, i would like to see instructions how to build it, because if it was that easy to do it, there should be a prebuilt version on official site released, i bet – Croll Oct 01 '15 at 19:52
  • @Joker The instructions are on qt wiki and are fairly clear. The dependencies are simple too, and you don't need to build any of the dependencies: they are all available as binaries - OpenSSL, Ruby, Perl, Python, DXSDK are about it. – Kuba hasn't forgotten Monica Oct 01 '15 at 20:01

4 Answers4

47

Building

You can use Qt in Visual Studio 2015 without any problems. As already stated in the comments, you have to build it from source but Qt is pretty straightforward to build. You can download the current (5.5) sources here and then follow this step by step example on building it.

I would also suggest reading more about the configure options, this might save you a lot of time. It might possibly save you some external dependencies as well if you skip components you do not need. My configuration for instance contains -skip qtwebkit -skip qtwebchannel so I do not need ruby or python.

I could totally omit step 3 from the link. Just be sure to open the Visual Studio Command Prompt (32/64 is important here) for configure and nmake.

Usage

For Visual Studio 2015, the Qt Add-In is not available anymore. But there is an Extension (Tools > Extensions & Updates) called Qt5Package or QtPackage which has the same functionality. After installing it, you have the Qt entry on your main toolbar where you have to specify a version and the path to the directory where you built it. This version will also be associated with the current project via the same menu.

If you load an existing project, you also have to convert it so the whole Qt functionality is used automatically. You can do this by opening the solution and right click on it; there should be an entry for the conversion to a QtAddin generated project.

I am using Qt 5.5 on Visual Studio 2015 with an old project and it is working without any issues.

Joel
  • 137
  • 2
  • 9
Bowdzone
  • 3,827
  • 11
  • 39
  • 52
  • To build Qt 5.6a, i need `qmake` installed. Don't you know where can i get the binary or installer for qmake only? – Croll Oct 14 '15 at 11:26
  • @Joker Qt should build `qmake` itself if I'm not mistaken. – Bowdzone Oct 14 '15 at 11:52
  • 1
    I was able to build qt based on 2015 with help from the links provided above, I was able to document my successes here: https://github.com/supamii/QttpServer – Son-Huy Pham Dec 11 '15 at 20:35
  • @Huytard were is your guide for building Qt ? – Chebhou Jan 07 '16 at 11:33
  • Can I use the Qt5Package Extension for 4.x? We are restricted to using the earlier licencing agreement from 4.7. – mike Jan 07 '16 at 17:12
  • 1
    @chebhou looks like there's a new beta version of Qt5.6 which should support MSVC 2015... because of this, i moved the guide to: https://github.com/supamii/QttpServer/blob/qs_dev/WINBUILD.md and obviously you should be able to SKIP the final section (Finally building QttpServer) – Son-Huy Pham Jan 07 '16 at 22:44
  • Sorry for digging in old threads but the building guide is just not working for me. Could you explain step 3? – David S Feb 18 '16 at 14:06
  • `For Visual Studio 2015, the Qt Add-In is not available anymore`. Do you mean they are not going to update this plugin to support VS 2015? I cannot find any official statement on this. – Isaac May 30 '16 at 15:40
  • @Isaac It seems the Add-In will not be updated but as stated in the answer, it is not needed anymore. The new plugin does the exact same thing and after a very short period you will hardly notice the difference between the new plugin and the old Add-in. I have not found any official source regarding this either but you may check the link in the updated answer for a discussion regarding this on the forum. – Bowdzone May 31 '16 at 05:43
  • @Bowdzone: Thanks, I see. I've also heard because this is a "add-in/plugin" and not an "extension", there are some difficulties in making it work with newer Visual Studio versions. I've also wonder how this new plugin is so small (~5MB) while the official add-in is ~200MB! Any thoughts on this? – Isaac May 31 '16 at 09:29
  • @Isaac No sorry. I only know, that it works for me so far. – Bowdzone May 31 '16 at 10:34
12

As of now, you can just download Qt for Visual Studio 2015. Here.

secretgenes
  • 1,291
  • 1
  • 19
  • 39
Julian Declercq
  • 1,536
  • 3
  • 17
  • 32
0

Qt have finally added support for Visual Studio 2013 and 2015 although it's only in beta right now. See QTVSADDINBUG-404 for progress and read the blog post From Visual Studio Add-In To Qt VS Tools (Beta).

parsley72
  • 8,449
  • 8
  • 65
  • 98
  • It seems that when you add files to the Qt project they don't are included in the VS project, and vice-versa. – mathiasfk Jan 24 '17 at 13:53
0

The Qt Windows could be added to the current project by copying all relating necessary files from the Qt stand-alone project to the current project. Specifically, the following steps must be conducted carefully.

  1. Create an example project of Qt inside a Visual C++ project by using a Qt Plugin Program. The windows must be designed inside this project carefully before adding to the existing project.
  2. Inside the existing project, add carefully the file heloqt.cpp, helloqt.h, ui_helloqt.h, qrc_helloqt.cpp, moc_helloqt.cpp in case of the Qt Project having the name of helloqt.
  3. Add some configurations of Additional include directories and Additional library directories and Additional Dependencies into the existing project.
  4. Compile and add some required *.dll files for running the program.

I have to do that because I want to use a graphic user interface in my big project, and this project is too big to be added into the Qt project inside the Visual C++ Studio.