The main application class handling startup as well as the main loop. More...
#include <pencil2d.h>
Signals | |
void | openFileRequested (QString filename) |
Emitted when the operating system requests that a file should be opened. More... | |
Public Member Functions | |
Pencil2D (int &argc, char **argv) | |
Initializes the application with the given command line arguments. More... | |
Status | handleCommandLineOptions () |
Parses supplied command line arguments and performs the appropriate actions, such as running the command line exporter or preparing the GUI. More... | |
bool | isInstanceOpen () |
Checks if multiple instances of Pencil2D are open. More... | |
bool | event (QEvent *event) override |
![]() | |
QApplication (int &argc, char **argv) | |
virtual bool | notify (QObject *receiver, QEvent *e) override |
void | focusChanged (QWidget *old, QWidget *now) |
QString | styleSheet () const const |
void | setStyleSheet (const QString &sheet) |
void | setAutoSipEnabled (const bool enabled) |
bool | autoSipEnabled () const const |
qApp qApp | |
![]() | |
QGuiApplication (int &argc, char **argv) | |
qreal | devicePixelRatio () const const |
bool | isSessionRestored () const const |
QString | sessionId () const const |
QString | sessionKey () const const |
bool | isSavingSession () const const |
void | fontDatabaseChanged () |
void | screenAdded (QScreen *screen) |
void | screenRemoved (QScreen *screen) |
void | primaryScreenChanged (QScreen *screen) |
void | lastWindowClosed () |
void | focusObjectChanged (QObject *focusObject) |
void | focusWindowChanged (QWindow *focusWindow) |
void | applicationStateChanged (Qt::ApplicationState state) |
void | layoutDirectionChanged (Qt::LayoutDirection direction) |
void | commitDataRequest (QSessionManager &manager) |
void | saveStateRequest (QSessionManager &manager) |
void | paletteChanged (const QPalette &palette) |
void | applicationDisplayNameChanged () |
void | fontChanged (const QFont &font) |
qGuiApp qGuiApp | |
![]() | |
QCoreApplication (int &argc, char **argv) | |
void | installNativeEventFilter (QAbstractNativeEventFilter *filterObj) |
void | removeNativeEventFilter (QAbstractNativeEventFilter *filterObject) |
void | aboutToQuit () |
void | organizationNameChanged () |
void | organizationDomainChanged () |
void | applicationNameChanged () |
void | applicationVersionChanged () |
Q_COREAPP_STARTUP_FUNCTION (QtStartUpFunction ptr) | |
void | qAddPostRoutine (QtCleanUpFunction ptr) |
void | qRemovePostRoutine (QtCleanUpFunction ptr) |
Q_DECLARE_TR_FUNCTIONS (context) | |
![]() | |
virtual const QMetaObject * | metaObject () const const |
QObject (QObject *parent) | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
Q_CLASSINFO (Name,Value) | |
Q_INTERFACES (...) | |
Q_PROPERTY (...) | |
Q_ENUMS (...) | |
Q_FLAGS (...) | |
Q_ENUM (...) | |
Q_FLAG (...) | |
Q_ENUM_NS (...) | |
Q_FLAG_NS (...) | |
Q_OBJECT Q_OBJECT | |
Q_GADGET Q_GADGET | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_SIGNALS Q_SIGNALS | |
Q_SIGNAL Q_SIGNAL | |
Q_SLOTS Q_SLOTS | |
Q_SLOT Q_SLOT | |
Q_EMIT Q_EMIT | |
Q_INVOKABLE Q_INVOKABLE | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Private Member Functions | |
void | installTranslators () |
Sets up translators for the application locale configured by the user or the system locale. | |
void | prepareGuiStartup (const QString &inputPath) |
Readies the graphical UI for entering the main loop. More... | |
Private Attributes | |
std::unique_ptr< MainWindow2 > | mainWindow |
std::unique_ptr< QLockFile > | mProcessLock |
The main application class handling startup as well as the main loop.
Definition at line 37 of file pencil2d.h.
|
explicit |
Initializes the application with the given command line arguments.
argc | Number of arguments |
argv | Values of the arguments |
Definition at line 44 of file pencil2d.cpp.
Status Pencil2D::handleCommandLineOptions | ( | ) |
Parses supplied command line arguments and performs the appropriate actions, such as running the command line exporter or preparing the GUI.
This method should be called before entering the main loop.
Definition at line 72 of file pencil2d.cpp.
bool Pencil2D::isInstanceOpen | ( | ) |
Checks if multiple instances of Pencil2D are open.
If multiple instances of Pencil2D are open (indicated by a process holding the lock to a specific file in the application data directory) then the user will be warned of the issues with running multiple instances.
Definition at line 109 of file pencil2d.cpp.
|
signal |
Emitted when the operating system requests that a file should be opened.
filename | The file to be opened |
|
private |
Readies the graphical UI for entering the main loop.
inputPath | Path of a file to be opened on startup. |
Definition at line 165 of file pencil2d.cpp.