Mr_Workalot
Mr_Workalot

Reputation: 37

How to run QT UI in MS Visual Studio 2019

I created my UI in QT creator, its in C++ code,

Now i want to connect it to my Backend(C++) which is in Visual Studio 2019, but Visual Studio does not detect these header files

#include <QMainWindow>
#include<QFile>
#include<QFileDialog>
#include<QTextStream>
#include<QMessageBox>
#include<QtPrintSupport/QPrintDialog>
#include<QtPrintSupport/QPrinter

it gives a red line under the #include, i guess its not detecting something and i have to install something, but how exactly do i do it, I have never used Visual Studio ???

Upvotes: 0

Views: 1873

Answers (2)

doron
doron

Reputation: 28892

Run qmake -tp vc. This will generate a visual studio project file that will build your qt application. qmake can be found in the bin directory of your qt install

Upvotes: 1

Tung Nguyen
Tung Nguyen

Reputation: 104

drescherjm already mentioned how to add a library to visual studio.

You need to find the directory to your Qt header files and Qt dll lib which is installed under C:\path\to\Qtxxx\lib and C:\path\to\Qtxxx\include.

Upvotes: 0

Related Questions