15int main(
int argc,
char **argv)
17 QApplication app(argc, argv);
18 QCoreApplication::setApplicationName(
"PixelTool"_L1);
19 QCoreApplication::setApplicationVersion(QLatin1StringView(qVersion()));
20 QCoreApplication::setOrganizationName(
"QtProject"_L1);
23 parser.addHelpOption();
24 parser.addVersionOption();
25 parser.addPositionalArgument(
"preview"_L1,
26 "The preview image to show."_L1);
32 if (!parser.positionalArguments().isEmpty()) {
33 const QString previewImageFileName = parser.positionalArguments().constFirst();
34 if (QFileInfo::exists(previewImageFileName)) {
35 QImage previewImage(previewImageFileName);
36 if (!previewImage.size().isEmpty())
37 pixelTool.setPreviewImage(previewImage);
43 QObject::connect(&app, &QApplication::lastWindowClosed,
44 &app, &QCoreApplication::quit);
46 return QCoreApplication::exec();