In this Qt5 C++ article i want to show you creating of First Console Application. So before this
if you want to get information about Qt5 C++ installation you can check the below link.
So first of all you need to create a new project in Qt5 C++
After that click on next and give a name to your project. also you can choose the location
of the Project.
After that click on next button and finish your project. you don’t need to
bring changes in here
So after that you can see this is the code, the codes is created automatically by Qt5 framework.
1 2 3 4 5 6 7 8 9 10 11 |
#include <QCoreApplication> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qDebug() << "Hello Qt5 Application"; return a.exec(); } |
If your familiar with C++ language, this code is similar to C++ language. you can see that we
have our main function and also we have a QCoreApplication, and like C++ for printing of the
text on the screen we are using cout, in here also we are using qDebug() function for printing
text in the console.
Run the complete code and you will see this result on the screen.
Also you can watch the complete video for this article
Subscribe and Get Free Video Courses & Articles in your Email