Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcoreapplication.cpp File Reference

(ed70faf87af42dea290853730093b3c2ecb90b0e)

#include "qcoreapplication.h"
#include "qcoreapplication_p.h"
#include "qabstracteventdispatcher.h"
#include "qcoreevent.h"
#include "qcoreevent_p.h"
#include "qeventloop.h"
#include "qmetaobject.h"
#include <private/qproperty_p.h>
#include "qcorecmdlineargs_p.h"
#include <qdatastream.h>
#include <qdebug.h>
#include <qdir.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qmutex.h>
#include <private/qloggingregistry_p.h>
#include <qscopeguard.h>
#include <qstandardpaths.h>
#include <qthread.h>
#include <qthreadstorage.h>
#include <private/qthread_p.h>
#include <qlibraryinfo.h>
#include <qpointer.h>
#include <qvarlengtharray.h>
#include <private/qfactoryloader_p.h>
#include <private/qfunctions_p.h>
#include <private/qlocale_p.h>
#include <private/qlocking_p.h>
#include <private/qhooks_p.h>
#include <stdlib.h>
#include <qtcore_tracepoints_p.h>
#include <algorithm>
#include <memory>
#include <string>
#include "moc_qcoreapplication.cpp"
+ Include dependency graph for qcoreapplication.cpp:

Go to the source code of this file.

Classes

struct  QCoreApplicationData
 

Typedefs

typedef QList< QtStartUpFunctionQStartUpFuncList
 
typedef QList< QtCleanUpFunctionQVFuncList
 

Functions

 Q_TRACE_PREFIX (qtcore, "#include <qcoreevent.h>")
 
 Q_TRACE_METADATA (qtcore, "ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;")
 
 Q_TRACE_POINT (qtcore, QCoreApplication_postEvent_entry, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_postEvent_exit)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_postEvent_event_compressed, QObject *receiver, QEvent *event)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_postEvent_event_posted, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_sendEvent, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_sendSpontaneousEvent, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_notify_entry, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtcore, QCoreApplication_notify_exit, bool consumed, bool filtered)
 
void qt_startup_hook ()
 
void qAddPreRoutine (QtStartUpFunction p)
 
void qAddPostRoutine (QtCleanUpFunction p)
 
void qRemovePostRoutine (QtCleanUpFunction p)
 
static void qt_call_pre_routines ()
 
void Q_CORE_EXPORT qt_call_post_routines ()
 
qsizetype qGlobalPostedEventsCount ()
 
QString qAppName ()
 
void Q_TRACE_INSTRUMENT (qtcore) QCoreApplicationPrivate
 
static bool doNotify (QObject *, QEvent *)
 
static void replacePercentN (QString *result, int n)
 
QString qtTrId (const char *id, int n)
 
static QString qAppFileName ()
 

Variables

static Q_CONSTINIT QBasicMutex globalRoutinesMutex
 
static Q_CONSTINIT bool preRoutinesCalled = false
 
static Q_CONSTINIT bool quitLockEnabled = true
 

Typedef Documentation

◆ QStartUpFuncList

Definition at line 252 of file qcoreapplication.cpp.

◆ QVFuncList

Definition at line 254 of file qcoreapplication.cpp.

Function Documentation

◆ doNotify()

static bool doNotify ( QObject * receiver,
QEvent * event )
static

Definition at line 1241 of file qcoreapplication.cpp.

References QCoreApplicationPrivate::checkReceiverThread(), false, QObject::isWidgetType(), QCoreApplicationPrivate::notify_helper(), Q_ASSERT, and qWarning.

Referenced by QQmlPropertyCapture::captureProperty(), QQmlPropertyCapture::captureProperty(), QQmlNotifierEndpoint::connect(), and QCoreApplication::notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Q_TRACE_INSTRUMENT()

◆ Q_TRACE_METADATA()

Q_TRACE_METADATA ( qtcore ,
"ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;"  )

◆ Q_TRACE_POINT() [1/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_notify_entry ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_POINT() [2/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_notify_exit ,
bool consumed,
bool filtered )

◆ Q_TRACE_POINT() [3/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_postEvent_entry ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_POINT() [4/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_postEvent_event_compressed ,
QObject * receiver,
QEvent * event )

◆ Q_TRACE_POINT() [5/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_postEvent_event_posted ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_POINT() [6/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_postEvent_exit  )

◆ Q_TRACE_POINT() [7/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_sendEvent ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_POINT() [8/8]

Q_TRACE_POINT ( qtcore ,
QCoreApplication_sendSpontaneousEvent ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_PREFIX()

Q_TRACE_PREFIX ( qtcore ,
"#include <qcoreevent.h>"  )

◆ qAddPostRoutine()

◆ qAddPreRoutine()

void qAddPreRoutine ( QtStartUpFunction p)

Adds a global routine that will be called from the QCoreApplication constructor. The public API is Q_COREAPP_STARTUP_FUNCTION.

Definition at line 265 of file qcoreapplication.cpp.

References globalRoutinesMutex, QCoreApplication::instance(), list, QList< T >::prepend(), preRoutinesCalled, and Q_ASSERT.

Referenced by QFontLoaderFonts::QFontLoaderFonts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qAppFileName()

static QString qAppFileName ( )
static

Definition at line 2464 of file qcoreapplication.cpp.

References QFile::decodeName(), QByteArray::fromRawData(), PATH_MAX, qstrlen(), and qt_readlink().

+ Here is the call graph for this function:

◆ qAppName()

QString qAppName ( )

Definition at line 574 of file qcoreapplication.cpp.

Referenced by WindowCreationData::create(), qRequireVersion(), and sm_performSaveYourself().

+ Here is the caller graph for this function:

◆ qGlobalPostedEventsCount()

qsizetype qGlobalPostedEventsCount ( )

Definition at line 348 of file qcoreapplication.cpp.

References QThreadData::current(), QList< T >::size(), and QPostEventList::startOffset.

+ Here is the call graph for this function:

◆ qRemovePostRoutine()

void qRemovePostRoutine ( QtCleanUpFunction p)
related

Definition at line 291 of file qcoreapplication.cpp.

Referenced by QFontLoaderFonts::~QFontLoaderFonts(), and QtQuickControls2NativeStylePlugin::~QtQuickControls2NativeStylePlugin().

+ Here is the caller graph for this function:

◆ qt_call_post_routines()

void Q_CORE_EXPORT qt_call_post_routines ( )

Definition at line 320 of file qcoreapplication.cpp.

References forever, globalRoutinesMutex, QList< T >::isEmpty(), list, and qSwap().

Referenced by QApplication::~QApplication(), QCoreApplication::~QCoreApplication(), QGuiApplication::~QGuiApplication(), QCommandLineParser::process(), QCommandLineParserPrivate::showHelp(), and QCommandLineParser::showVersion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_call_pre_routines()

static void qt_call_pre_routines ( )
static

Definition at line 300 of file qcoreapplication.cpp.

References globalRoutinesMutex, list, and preRoutinesCalled.

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ qt_startup_hook()

void qt_startup_hook ( )

Definition at line 248 of file qcoreapplication.cpp.

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ qtTrId()

QString qtTrId ( const char * id,
int n )

Definition at line 2388 of file qcoreapplication.cpp.

References QCoreApplication::translate().

Referenced by QQmlTranslation::QsTrIdData::translate(), and QV4::ExecutableCompilationUnit::translateFrom().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replacePercentN()

static void replacePercentN ( QString * result,
int n )
static

Definition at line 2296 of file qcoreapplication.cpp.

References QString::arg(), fmt, QString::replace(), and QString::size().

Referenced by QCoreApplication::translate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ globalRoutinesMutex

◆ preRoutinesCalled

Q_CONSTINIT bool preRoutinesCalled = false
static

◆ quitLockEnabled

Q_CONSTINIT bool quitLockEnabled = true
static

Definition at line 394 of file qcoreapplication.cpp.