I have a small console app that will do some post install file & text proccessing. I need it to be self terminating & I need it to NOT show a console while running. I tried a.quit() & a.exit() to terminate, but neither one worked. I'm not sure how to supress the console window. The app will run on Win.
Any help is appreciated.
Thanx,
Ed
#include <QTextStream>
#include <QString>
#include <QFile>
int main(int argc, char *argv[])
{
QFile file("fixPath.txt");
{
while (not in.atEnd())
{
str1 = in.readLine();
cout << str1 << endl;
}
file.close();
}
return a.exec();
}
#include <QTextStream>
#include <QString>
#include <QFile>
QTextStream cout(stdout, QIODevice::WriteOnly);
QTextStream cerr(stderr, QIODevice::WriteOnly);
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString str1, str2;
QFile file("fixPath.txt");
if(file.open(QIODevice::ReadOnly))
{
QTextStream in(&file);
while (not in.atEnd())
{
str1 = in.readLine();
cout << str1 << endl;
}
file.close();
}
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks