// //#include //#include //#include // //#include "main_window.h" // //int main(int argc, char *argv[]) //{ // // QApplication app(argc, argv); // // MainWindow mainWin; // // return app.exec(); //} // #include #include class myWidget : public QMainWindow { public: myWidget() { QWidget *central = new QWidget; setCentralWidget(central); } }; void MsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { std::cout << msg.toStdString() << std::endl; } int main(int argc, char*argv[]) { // Install message handler to output qDebug, qWarning and qCritical qInstallMessageHandler(MsgHandler); // Allocate console AllocConsole(); freopen("CONOUT$", "w", stdout); QApplication app(argc,argv); std::cout << "Testing cout" << std::endl; qDebug() << "Testing qDebug"; qWarning() << "Testing qWarning"; qCritical() << "Testing qCritical"; myWidget w; w.resize(600,700); w.show(); return app.exec(); }