Reputation: 311
I have VS 2017, qt-opensource-windows-x86-msvc2015_64-5.8.0, qt-vsaddin-msvc2017-2.6.0-rev.07.
https://api-2d3d-cad.com/c-qt/ to setup.
Qt VS Tools widget is present, can make Qt Console Application.
But:
#include <QMainWindow>
#include <QLabel>
Cannot open source file "QApplication"
Cannot open source file "QLabel"
https://stackoverflow.com/a/16682269/10226040 - tried, not working.
Thx.
Upvotes: 1
Views: 6374
Reputation: 270
To use Qt libs in Visual studio do next steps! This answer is based on Visual studio 2017
! on other versions, differences are only on menus or settings interfaces!
Install Qt Vs Tools
, check its version compatibility with Visual studio
In Qt Versions
tab, add installed Qt libs with its path and name, and set default Qt/Win version
On Solution Explorer
view, open project properties, go Qt Project Settings
and on Qt Modules
tab set required modules such as Core
.
You can see other settings in tabs
Qt Meta-Object Compiler
to change moc
file generation settings, Qt User Interface Compiler
to change form
and ui
compilation settings.
If you have any form file, i.e. *.ui
file, you can get its properties and check followings are set properly by default! or modify them as you need!
Upvotes: 2