1 #ifndef QTBACKGROUNDPROCESS_APP_H 2 #define QTBACKGROUNDPROCESS_APP_H 4 #include "QtBackgroundProcess/qtbackgroundprocess_global.h" 6 #include <QtCore/qcommandlineparser.h> 7 #include <QtCore/qcoreapplication.h> 8 #include <QtCore/qexception.h> 24 const char *what()
const noexcept
override;
27 void raise()
const override;
37 friend class AppPrivate;
40 Q_PROPERTY(
QString instanceID READ instanceID WRITE setInstanceID RESET createDefaultInstanceID)
42 Q_PROPERTY(
bool forwardMasterLog READ forwardMasterLog WRITE setForwardMasterLog)
44 Q_PROPERTY(
bool autoStartMaster READ autoStartMaster WRITE setAutoStartMaster)
46 Q_PROPERTY(
bool ignoreMultiStarts READ ignoreMultiStarts WRITE setIgnoreMultiStarts)
48 Q_PROPERTY(
bool autoDeleteTerminals READ autoDeleteTerminals WRITE setAutoDeleteTerminals)
50 Q_PROPERTY(
bool autoKillTerminals READ autoKillTerminals WRITE setAutoKillTerminals)
52 Q_PROPERTY(
QList<
Terminal*> connectedTerminals READ connectedTerminals NOTIFY connectedTerminalsChanged)
56 App(
int &argc,
char **argv,
int flags = ApplicationFlags);
63 bool forwardMasterLog() const;
65 bool autoStartMaster() const;
67 bool ignoreMultiStarts() const;
69 bool autoDeleteTerminals() const;
71 bool autoKillTerminals() const;
78 void setShutdownRequestFunction(const
std::function<
bool(const
QCommandLineParser &,
int&)> &function);
80 void setShutdownRequestFunction(const
std::function<
bool(
Terminal*,
int&)> &function);
86 QList<Terminal*> connectedTerminals() const;
90 void createDefaultInstanceID(
bool overwrite = true);
92 void setInstanceID(
QString instanceID,
bool useAsSeed = true);
94 void setForwardMasterLog(
bool forwardMasterLog);
96 void setAutoStartMaster(
bool autoStartMaster);
98 void setIgnoreMultiStarts(
bool ignoreMultiStarts);
100 void setAutoDeleteTerminals(
bool autoDeleteTerminals,
bool changeCurrent = false);
102 void setAutoKillTerminals(
bool autoKillTerminals,
bool killCurrent = false);
108 void commandReceived(
QSharedPointer<QCommandLineParser> parser,
bool isStarter, QPrivateSignal);
111 void connectedTerminalsChanged(
QList<Terminal*> connectedTerminals, QPrivateSignal);
115 virtual
void setupParser(QCommandLineParser &parser,
bool useShortOptions = true);
117 virtual
int startupApp(const QCommandLineParser &parser);
119 virtual
bool requestAppShutdown(Terminal *terminal,
int &exitCode);
128 #define qApp static_cast<QtBackgroundProcess::App*>(QCoreApplication::instance()) 130 #endif // QTBACKGROUNDPROCESS_APP_H Represents a connection to a terminal in the master process.
The Namespace containing all classes of the QtBackgroundProcess module.
Will be thrown, if you perform an operation, that is not allowed in running state.
The background process application. The main class of QtBackgroundProcess.