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?

3
  • 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 1, 2015 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 1, 2015 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. Oct 1, 2015 at 20:01

4 Answers 4

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.

11
  • 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, 2015 at 11:26
  • @Joker Qt should build qmake itself if I'm not mistaken.
    – Bowdzone
    Oct 14, 2015 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: github.com/supamii/QttpServer Dec 11, 2015 at 20:35
  • @Huytard were is your guide for building Qt ?
    – Chebhou
    Jan 7, 2016 at 11:33
  • 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: github.com/supamii/QttpServer/blob/qs_dev/WINBUILD.md and obviously you should be able to SKIP the final section (Finally building QttpServer) Jan 7, 2016 at 22:44
12

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

2
  • But no 2017 yet, I guess? I can't find it anywhere. Apr 9, 2017 at 3:57
  • @foobarbecue It took a few months (at least) for 15 to come out so I guess you might expect the same for 17. Apr 9, 2017 at 10:56
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).

1
  • 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, 2017 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.