::AllocConsole(); freopen("CONOUT$", "wt", stdout); freopen("CONIN$", "rt", stdin);
int main(int argc, char *argv[]){ QCoreApplication a( argc, argv ); std::cout << "console application" << std::endl; return a.exec();}
int main(int argc, char **argv) { QApplication app(argc, argv); MainWindow window; window.show(); return app.exec(); }
int main(int argc, char *argv[]){ QApplication a(argc, argv); TestTextEdit w; w.show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); std::cout << "console application" << std::endl; return a.exec();}