summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 80912ff409..4922e2e778 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -190,6 +190,15 @@ QApplicationPrivate::~QApplicationPrivate()
any given time. For non-QWidget based Qt applications, use QGuiApplication instead,
as it does not depend on the \l QtWidgets library.
+ Some GUI applications provide a special batch mode ie. provide command line
+ arguments for executing tasks without manual intervention. In such non-GUI
+ mode, it is often sufficient to instantiate a plain QCoreApplication to
+ avoid unnecessarily initializing resources needed for a graphical user
+ interface. The following example shows how to dynamically create an
+ appropriate type of application instance:
+
+ \snippet code/src_gui_kernel_qapplication.cpp 0
+
The QApplication object is accessible through the instance() function that
returns a pointer equivalent to the global qApp pointer.