|
Multi diag tools
|
Abstract base of a main function in Qt console application with a event loop. More...
#include <AbstractConsoleApplicationMainFunction.h>
Inherits QObject.
Public Slots | |
| virtual void | aboutToQuit () |
| Cleanup code. More... | |
Public Member Functions | |
| AbstractConsoleApplicationMainFunction (QObject *parent=nullptr) | |
| Constructor. | |
| virtual int | runMain ()=0 |
| main function implementation | |
Static Public Member Functions | |
| static QStringList | getArguments () |
| Returns the list of command-line arguments. More... | |
Abstract base of a main function in Qt console application with a event loop.
The class declaration MyMainFunction.h could look like:
Example of the implementation in MyMainFunction.cpp:
Finaly, in main.cpp:
Definition at line 63 of file AbstractConsoleApplicationMainFunction.h.
|
virtualslot |
Cleanup code.
If some cleanup has to be done before the application exists, this function can be implemented. See QCoreApplication documentation to know why this is a recommanded way to do cleanup.
This default implementation does nothing.
Definition at line 41 of file AbstractConsoleApplicationMainFunction.cpp.
|
static |
Returns the list of command-line arguments.
Returns QCoreApplication::arguments(). As stated in QCoreApplication documentation, this method is slow, so the result should be stored in a variable if accessed many times (this is wy it is prefixed with get here)
Definition at line 34 of file AbstractConsoleApplicationMainFunction.cpp.
1.8.11