I made a simple console app which accepts a user’s name and prints it.
It does not work as expected. Here is the code:
#include <QCoreApplication>
#include <QTextStream>
void do_qt()
{
QTextStream qin(stdin);
QTextStream qout(stdout);
qout << "Enter your name: ";
QString name = qin.readLine();
qout << "Hello " + name + "n";
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
do_qt();
return a.exec();
}
This is the output