int main(int argc, char *argv[]) { // Avoid performance issues with X11 engine when rendering objects #ifdef Q_WS_X11 QApplication::setGraphicsSystem(QLatin1String("raster")); #endif QApplication a(argc, argv); a.setOrganizationDomain(QLatin1String("mapeditor.org")); a.setApplicationName(QLatin1String("TmxViewer")); a.setApplicationVersion(QLatin1String("1.0")); CommandLineOptions options; parseCommandLineArguments(options); /* if (options.showVersion) showVersion(); if (options.showHelp || (options.fileToOpen.isEmpty() && !options.showVersion)) showHelp(); if (options.showVersion || options.showHelp || options.fileToOpen.isEmpty()) return 0; */ TmxViewer w; w.viewMap(options.fileToOpen); w.show(); return a.exec(); }
int main(int argc, char *argv[]) { #ifdef Q_OS_WIN // Make console output work on Windows, if running in a console. if (AttachConsole(ATTACH_PARENT_PROCESS)) { FILE *dummy = nullptr; freopen_s(&dummy, "CONOUT$", "w", stdout); freopen_s(&dummy, "CONOUT$", "w", stderr); } #endif QApplication a(argc, argv); a.setOrganizationDomain(QLatin1String("mapeditor.org")); a.setApplicationName(QLatin1String("TmxViewer")); a.setApplicationVersion(QLatin1String("1.0")); CommandLineOptions options; parseCommandLineArguments(options); if (options.showVersion) showVersion(); if (options.showHelp || (options.fileToOpen.isEmpty() && !options.showVersion)) showHelp(); if (options.showVersion || options.showHelp || options.fileToOpen.isEmpty()) return 0; TmxViewer w; if (!w.viewMap(options.fileToOpen)) return 1; w.show(); return a.exec(); }