导出数据转spine
This commit is contained in:
1 parent
d258d4f435
commit
3a7c0b4092
65 files changed
+6000
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#include "ui/MainWindow.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QPixmap>
|
||||
#include <QTimer>
|
||||
|
||||
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();
|
||||
}
|
||||
Reference in new issue
Block a user