#include "ui/MainWindow.hpp" #include #include #include #include int main(int argc, char** argv) { QApplication application(argc, argv); QCoreApplication::setApplicationName("DateToSpine"); QCoreApplication::setOrganizationName("DateToSpine"); dts::MainWindow window; window.show(); const auto arguments = application.arguments(); for (int index = 1; index < arguments.size(); ++index) { if (arguments[index] == "--screenshot") { ++index; } else if (!arguments[index].startsWith('-')) { window.openResourcePath(arguments[index]); } } const int screenshotOption = arguments.indexOf("--screenshot"); if (screenshotOption >= 0 && screenshotOption + 1 < arguments.size()) { const auto screenshotPath = arguments[screenshotOption + 1]; QTimer::singleShot(250, &application, [&application, &window, screenshotPath] { window.grab().save(screenshotPath); application.quit(); }); } if (application.arguments().contains("--smoke-test")) { QTimer::singleShot(100, &application, &QCoreApplication::quit); } return application.exec(); }