git repos / SagoImageBrowser

blame: src/main.cpp

normal view · raw

032aa1e1 Poul Sander 2026-02-19 18:55 1
#include <QApplication>
48607848 Poul Sander 2026-05-19 19:20 2
#include <QTimer>
032aa1e1 Poul Sander 2026-02-19 18:55 3
#include "mainwindow.h"
032aa1e1 Poul Sander 2026-02-19 18:55 4
032aa1e1 Poul Sander 2026-02-19 18:55 5
int main(int argc, char *argv[])
032aa1e1 Poul Sander 2026-02-19 18:55 6
{
032aa1e1 Poul Sander 2026-02-19 18:55 7
    QApplication app(argc, argv);
032aa1e1 Poul Sander 2026-02-19 18:55 8
032aa1e1 Poul Sander 2026-02-19 18:55 9
    MainWindow w;
f00af1eb Poul Sander 2026-02-23 19:17 10
    w.showMaximized();
032aa1e1 Poul Sander 2026-02-19 18:55 11
48607848 Poul Sander 2026-05-19 19:20 12
    const QStringList args = app.arguments();
48607848 Poul Sander 2026-05-19 19:20 13
    if (args.size() > 1) {
48607848 Poul Sander 2026-05-19 19:20 14
        const QString path = args.at(1);
48607848 Poul Sander 2026-05-19 19:20 15
        QTimer::singleShot(0, &w, [&w, path]() { w.openPath(path); });
48607848 Poul Sander 2026-05-19 19:20 16
    }
48607848 Poul Sander 2026-05-19 19:20 17
032aa1e1 Poul Sander 2026-02-19 18:55 18
    return app.exec();
032aa1e1 Poul Sander 2026-02-19 18:55 19
}
1970-01-01 00:00 20