23#include <QFileOpenEvent>
25#include <QLibraryInfo>
29#include <QStandardPaths>
33#include "commandlineexporter.h"
34#include "commandlineparser.h"
35#include "mainwindow2.h"
37#include "platformhandler.h"
40#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
59#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
83 QString inputPath = parser.inputPath();
102 parser.transparency()))
114 if (!mProcessLock->tryLock(10))
125bool Pencil2D::event(
QEvent* event)
130 Q_ASSERT(fileOpenEvent);
144#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
149 std::setlocale(LC_NUMERIC,
"C");
152 std::unique_ptr<QTranslator> qtTranslator(
new QTranslator(
this));
153#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
162 std::unique_ptr<QTranslator> pencil2DTranslator(
new QTranslator(
this));
163 if (pencil2DTranslator->load(locale,
"pencil",
"_",
":/i18n/"))
171 PlatformHandler::configurePlatformSpecificSettings();
177 mainWindow->openStartupFile(inputPath);
Handles command line export jobs.
bool process(const QString &inputPath, const QStringList &outputPaths, const QString &camera, int width, int height, int startFrame, int endFrame, bool transparency)
Exports a Pencil2D file according to the specified options.
bool isInstanceOpen()
Checks if multiple instances of Pencil2D are open.
Pencil2D(int &argc, char **argv)
Initializes the application with the given command line arguments.
void openFileRequested(QString filename)
Emitted when the operating system requests that a file should be opened.
void prepareGuiStartup(const QString &inputPath)
Readies the graphical UI for entering the main loop.
void installTranslators()
Sets up translators for the application locale configured by the user or the system locale.
Status handleCommandLineOptions()
Parses supplied command line arguments and performs the appropriate actions, such as running the comm...
virtual bool event(QEvent *e) override
void setWindowIcon(const QIcon &icon)
void setApplicationName(const QString &application)
void setApplicationVersion(const QString &version)
bool installTranslator(QTranslator *translationFile)
void setOrganizationDomain(const QString &orgDomain)
void setOrganizationName(const QString &orgName)
QString absoluteFilePath(const QString &fileName) const const
QString filePath(const QString &fileName) const const
bool mkpath(const QString &dirPath) const const
QEvent::Type type() const const
void setApplicationDisplayName(const QString &name)
void setDesktopFileName(const QString &name)
QString location(QLibraryInfo::LibraryLocation loc)
bool isEmpty() const const
void setDefault(const QLocale &locale)
QMessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString tr(const char *sourceText, const char *disambiguation, int n)
QVariant value(const QString &key, const QVariant &defaultValue) const const
QString writableLocation(QStandardPaths::StandardLocation type)
bool isEmpty() const const
QString toString() const const