Installing Qt tools for Visual Studio 2019 - c++

I've tried installing the Qt tools for Visual Studio 3 times now. Each time, the results are not usable. All the instructions I'm seeing on the web are from clearly much earlier versions. The main problem I'm having now is that the Qt UI application template isn't showing up in the list of project types. I've seen instructions that say I should see a Qt menu item in VS and that isn't happening, but maybe that's from a past version. Does anyone have any experience with how to correctly install the Qt Tools in the current Visual Studio version?
A secondary question is, assuming one gets the tools installed, can you use the VS designer view, when using Qt form elements?
Thanks in advance.

Related

Setting up Qt for use in a project in Visual Studio

I am trying to use Qt to make a simple GUI program in C++ using Microsoft Visual Studio. It's for a school project, but my professor has given very little guidance on how to get the Qt library working in Visual Studio, and I can't seem to follow the information given on the website. I know it's a big ask, but would anyone be able to walk me through how to get things up and running?
I recently installed and used QT at home using VS19 Community and latest QT Open Source.
The following YouTube video should help you get started.
Configure VS19 to create QT5 Apps
The Summary:
Install QT: Choose advanced, and install the latest version of QT + the support for version of Visual Studio you are using.
Install the "QT Visual Studio Tools" extension via the Visual Studio "Manage Extensions"
After installed, From inside VS, set the QT version under the Extensions-->QT VS Tools-->QT Options.
Create a new project.
-- Search for "QT" as it may not appear in the list.
And you're off.

Qt VS Tools: error reading VS project settings

I develop an application using Visual Studio 2015 + Qt VS Tools extension. For me it's first time I used Qt (version 5.14.1) in my project. Everything was working fine until something wrong happened.
I was asked to make release version of my application, it worked fine on Windows 10 and Windows 7 64-bit systems. Then I set the project configuration back to Debug x64 to continue my work. First strange thing I noticed - when I double-clicked on *.ui form files in my Solution Explorer, Visual Studio crashed and reloaded without any error, Qt Designer doesn't launch.
What I tried:
First I tried to open Qt Designer externally (from bin folder in Qt directory) and open my form - it worked.
I tried another project made in VS 2015 + Qt VS Tools Extension - same problem.
I tried to remove my Qt Version and re-add it. And here it comes: Error screenshot. It also occurs without using system enviroment variable $(QTDIR).
I reinstalled Qt to my PC (installed version 5.14.2 instead of 5.14.1), same error.
I reinstalled Visual Studio 2015, same error.
I tried to reset my Visual Studio settings and parameters to default, no results.
I installed Visual Studio 2019. The problem is still present.
UPD:
I cleared Visual Studio cache according to these instructions. It didn't work for me.
I removed every Visual C++ Redistributables from my PC and installed the latest version from Microsoft site. It also didn't work.
The error occurs even if no project is opened, so the problem is caused either by Visual Studio 2015, by Qt 5.14, or by Qt VS Tools extension.
P.S. Sorry if my english wasn't perfect. Waiting for any ideas on fixing this problem.
For any future readers who have this problem, start your maintenance tool or Qt installer, e.g. C:\Qt\MaintenanceTool.exe, "Add or remove components", and then make sure Qt/<version>/MSVC is installed, as shown in the image below:
.
Then you'll be able to select that Qt version instead of MinGW, since the Visual Studio extension only supports the MSVC compiler and not MinGW.
Encountered the exact same problem and the only solution I have found was reverting to an older version of the Qt Visual Studio Tools extension.
Visual Studio has been painfully persistent about updating the version even once I installed an older one, so make sure to disable automatic extension updates (Extensions → Manage Extensions → Extension Settings → Uncheck Automatically search for updates/Automatically update extensions).
Hope it helps.
To solve your problem, you need to remove the QTDIR and QMAKESPEC environment variables that remain in Windows after installing older versions of Qt.
Well, after some more procedures that didn't help, I just did clean-reinstallation for my Windows 10. Fortunately, that helped :)

Add WIN32 Console Project Template To Visual Studio Community 2017 15.5.2?

I recently installed Visual Studio Community 2017 15.5.2 version for C++ basically and I am unable to find the option of Win32 Console Application.
I have already read many post to fix it but can't. Yes, I have installed C++ in VS. I have installed the following workloads:
Desktop development with C++ and
.NET desktop development.
I have tried to install packages through VS command prompt but it didn't fix my issue. I have tried reinstalling it and repairing it but didn't find anything. I tried to find it in File -> New -> Project -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard -> ... but there was no option.
I want to develop simple games in C++ so i need Win32 console application option in VS. I have installed similar packages in the VS installer but it didn't help!
I have looked for it in many options but didn't got what i wanted! I have also read many posts and forums to fix it but cannot. I almost tried everything they said in those forums!
If someone knows the solution please explain it briefly and tell me which packages to install or what to do?
Also tell me possible reasons for the cause so i can fix it on my own. And if not possible tell me an alternative to it.
seems that your not alone. The problem is know well, and already asked in Microsoft forum.
From their side they say not change has been apply in last updates, just few re-implement.
You may see same question here: https://developercommunity.visualstudio.com/content/problem/93159/cant-find-win32-console-application-for-new-projec.html
In that case, what i would suggest you, is to install VS 2015 that still working well.
Good luck body.

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

I have searched everywhere but I can't seem to find support for the latest Visual Studio version.
Is there some way of getting round this?
Qt 5.9.1 and later versions are pre-built for VS 2017 64 bits. You can download it from official Qt webpage. If you need 32 bits I'm sorry to tell you that you will need to compile it manually (good luck, it is usually not a straightforward nor simple process). See updates below.
In addition, you will need the VS Tools. You can download latest version for VS 2017 from here (official downloads page hasn't been updated yet about this). There is no stable version for VS 2017 (see update below), but the latest (although a bit old) development build fixes major integration problems. You can downloaded from here.
Finally, just take a look at the official documentation for a quick tutorial about how to use it. Basically:
Configure your Qt version with the VS Tools: in VS go to Qt VS Tools > Qt Options and add your installation.
You can now create a new project. The extension will add a new templates collection under Visual C++ called Qt, there you will probably use the Qt GUI Application.
The rest is standard Qt programming. The VS Tools take charge of all the compilation of .ui files (interface design), moc'ing needed files, translations (if used), etc.
UPDATE: as mentioned in this post from MSDN, binaries generated usign VS 2015 are compatible with VS 2017. So in this case, the Qt compilations for 2015 (32 and 64 bits) should also work.
UPDATE (2018-9-13): since two months ago we've been using the 32-bits build from VS 2015 in VS 2017 (including the latest 15.8.4 update). No issues found so far in this sense.
UPDATE (2018-12-10): Qt 5.12.0 (LTS) comes with precompiled binaries for VS 2017 32 and 64 bits.
UPDATE: last February was launched the first official release of the VS Tools for VS 2017. You can read more on it in the Qt's blog.

No console application in Visual Studio 2015?

I know this might sound extremely dumb, but I can't find the console application template in visual studio 2015. When installed I clicked on custom and selected everything so I wouldn't have to go through the hassle of adding files later on so of course I have visual c++ installed. But for some reason there's no console application template.
Any ideas?
I'm using the community edition.
It's located under Templates->Visual C++->Win32->Win32 Console Application.
If you cannot find it there, it probably means you did not install the Windows SDK. Go to the Control Panel->Programs and Features, select Microsoft Visual Studio Community 2015, right click on it and select Change.
The SDK is hidden quite well in the list of installable features. You can find it under Windows and Web Development->Universal Windows App Development Tools. Make sure the Windows 10 SDK is selected. By default it's not and I tend to forget to check it when installing VS2015 because it's so damn well hidden.
SOLVED !!!
it is generally with windows 10 or xp
so when you go to visual c++ there is option of install windows support for ...
and let it download
bingo!!
next time you can see it there
install these two
after installation
I have same problem. This is the way of show before i fix it.
then check you have proper internet connection. net double click and install both. now you can create c++ project.
This is new appearance..
thank you.
Unable to download using VS2015 installer. Even when set to download from internet it will fail
Better download winsdksetup.exe at https://developer.microsoft.com/es-es/windows/downloads/sdk-archive/