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.
What is Qt5 Console Application?
Qt5 Console Application is a type of application built using Qt framework, specifically designed to run in a console or terminal environment. Qt framework is a powerful cross-platform framework for building graphical user interfaces (GUIs) as well as non-GUI applications.
While Qt is commonly associated with GUI development, it also provides support for developing console applications. These console applications can have the features and functionalities of the Qt framework, such as signals and slots, resource management, threading, and more, to build efficient command-line tools.
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.
Subscribe and Get Free Video Courses & Articles in your Email