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
QCoreApplicationPrivate Class Reference

#include <qcoreapplication_p.h>

+ Inheritance diagram for QCoreApplicationPrivate:
+ Collaboration diagram for QCoreApplicationPrivate:

Classes

struct  QPostEventListLocker
 

Public Types

enum  Type { Tty , Gui }
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QCoreApplicationPrivate (int &aargc, char **aargv)
 
 ~QCoreApplicationPrivate ()
 
void init ()
 
QString appName () const
 
QString appVersion () const
 
void initConsole ()
 
bool sendThroughApplicationEventFilters (QObject *, QEvent *)
 
virtual void createEventDispatcher ()
 
virtual void eventDispatcherReady ()
 
void ref ()
 
void deref ()
 
virtual bool canQuitAutomatically ()
 
void quitAutomatically ()
 
virtual void quit ()
 
void cleanupThreadData ()
 
void appendApplicationPathToLibraryPaths (void)
 
void execCleanup ()
 
void processCommandLineArguments ()
 
QString qmljsDebugArgumentsString () const
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static void initLocale ()
 
static bool checkInstance (const char *method)
 
static bool sendThroughObjectEventFilters (QObject *, QEvent *)
 
static bool notify_helper (QObject *, QEvent *)
 
static void setEventSpontaneous (QEvent *e, bool spontaneous)
 
static void removePostedEvent (QEvent *)
 Removes event from the queue of posted events, and emits a warning message if appropriate.
 
static QThreadmainThread ()
 
static bool threadRequiresCoreApplication ()
 
static void sendPostedEvents (QObject *receiver, int event_type, QThreadData *data)
 
static void checkReceiverThread (QObject *receiver)
 
static QPostEventListLocker lockThreadPostEventList (QObject *object)
 
static bool isTranslatorInstalled (QTranslator *translator)
 
static void setApplicationFilePath (const QString &path)
 
static void clearApplicationFilePath ()
 
static bool testAttribute (uint flag)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QAtomicInt quitLockRef
 
int & argc
 
char ** argv
 
QTranslatorList translators
 
QReadWriteLock translateMutex
 
QCoreApplicationPrivate::Type application_type
 
QString cachedApplicationDirPath
 
bool in_exec
 
bool aboutToQuitEmitted
 
bool threadData_clean
 
QString qmljs_debug_arguments
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Static Public Attributes

static QBasicAtomicPointer< QThreadtheMainThread = Q_BASIC_ATOMIC_INITIALIZER(nullptr)
 
static QBasicAtomicPointer< voidtheMainThreadId = Q_BASIC_ATOMIC_INITIALIZER(nullptr)
 
static QStringcachedApplicationFilePath = nullptr
 
static QAbstractEventDispatchereventDispatcher = nullptr
 
static bool is_app_running = false
 
static bool is_app_closing = false
 
static bool setuidAllowed = false
 
static uint attribs
 

Detailed Description

Definition at line 51 of file qcoreapplication_p.h.

Member Enumeration Documentation

◆ Type

Enumerator
Tty 
Gui 

Definition at line 59 of file qcoreapplication_p.h.

Constructor & Destructor Documentation

◆ QCoreApplicationPrivate()

QCoreApplicationPrivate::QCoreApplicationPrivate ( int & aargc,
char ** aargv )

Definition at line 426 of file qcoreapplication.cpp.

References argc, argv, QThread::currentThread(), is_app_closing, Q_UNLIKELY, qFatal, QT_MAKE_CHECKED_ARRAY_ITERATOR, qWarning, setuidAllowed, and theMainThread.

+ Here is the call graph for this function:

◆ ~QCoreApplicationPrivate()

QCoreApplicationPrivate::~QCoreApplicationPrivate ( )

Definition at line 473 of file qcoreapplication.cpp.

References cleanupThreadData(), and clearApplicationFilePath().

+ Here is the call graph for this function:

Member Function Documentation

◆ appendApplicationPathToLibraryPaths()

void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths ( void )

Definition at line 560 of file qcoreapplication.cpp.

References QString::append(), QCoreApplication::applicationFilePath(), QDir::canonicalPath(), and QFile::exists().

+ Here is the call graph for this function:

◆ appName()

QString QCoreApplicationPrivate::appName ( ) const

Definition at line 152 of file qcoreapplication.cpp.

References argv, QString::fromLocal8Bit(), QString::isEmpty(), and QStringLiteral.

Referenced by Q_TRACE_INSTRUMENT().

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

◆ appVersion()

QString QCoreApplicationPrivate::appVersion ( ) const

Definition at line 165 of file qcoreapplication.cpp.

References context, and QStringLiteral.

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ canQuitAutomatically()

bool QCoreApplicationPrivate::canQuitAutomatically ( )
virtual

Reimplemented in QGuiApplicationPrivate.

Definition at line 2100 of file qcoreapplication.cpp.

Referenced by QGuiApplicationPrivate::canQuitAutomatically().

+ Here is the caller graph for this function:

◆ checkInstance()

bool QCoreApplicationPrivate::checkInstance ( const char * method)
static

Definition at line 196 of file qcoreapplication.cpp.

References qWarning.

Referenced by QCoreApplication::exec(), QCoreApplication::installTranslator(), and QCoreApplication::removeTranslator().

+ Here is the caller graph for this function:

◆ checkReceiverThread()

void QCoreApplicationPrivate::checkReceiverThread ( QObject * receiver)
static

Definition at line 543 of file qcoreapplication.cpp.

References QString::asprintf(), QThread::currentThread(), QObject::objectName, Q_ASSERT_X, Q_UNUSED, qUtf16Printable, and QObject::thread().

Referenced by doNotify(), and QApplication::notify().

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

◆ cleanupThreadData()

void QCoreApplicationPrivate::cleanupThreadData ( )

Definition at line 488 of file qcoreapplication.cpp.

References QBasicAtomicPointer< X >::loadRelaxed(), QObjectPrivate::threadData, and threadData_clean.

Referenced by ~QCoreApplicationPrivate(), and QGuiApplicationPrivate::~QGuiApplicationPrivate().

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

◆ clearApplicationFilePath()

static void QCoreApplicationPrivate::clearApplicationFilePath ( )
inlinestatic

Definition at line 150 of file qcoreapplication_p.h.

Referenced by ~QCoreApplicationPrivate(), and QCoreApplication::applicationFilePath().

+ Here is the caller graph for this function:

◆ createEventDispatcher()

void QCoreApplicationPrivate::createEventDispatcher ( )
virtual

Reimplemented in QGuiApplicationPrivate, and QApplicationPrivate.

Definition at line 514 of file qcoreapplication.cpp.

References QThreadData::current(), eventDispatcher, and Q_ASSERT.

Referenced by Q_TRACE_INSTRUMENT().

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

◆ deref()

void QCoreApplicationPrivate::deref ( )

Definition at line 2092 of file qcoreapplication.cpp.

References QCoreApplication::quitLockEnabled.

◆ eventDispatcherReady()

void QCoreApplicationPrivate::eventDispatcherReady ( )
virtual

Reimplemented in QGuiApplicationPrivate.

Definition at line 523 of file qcoreapplication.cpp.

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ execCleanup()

void QCoreApplicationPrivate::execCleanup ( )

Definition at line 1514 of file qcoreapplication.cpp.

References QEvent::DeferredDelete, qCDebug, QThreadData::quitNow, and QCoreApplication::sendPostedEvents().

+ Here is the call graph for this function:

◆ init()

void QCoreApplicationPrivate::init ( )

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ initConsole()

void QCoreApplicationPrivate::initConsole ( )

Definition at line 581 of file qcoreapplication.cpp.

References Qt::CaseInsensitive, QString::compare(), QString::isEmpty(), out, Q_ASSERT, and qEnvironmentVariable().

Referenced by Q_TRACE_INSTRUMENT().

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

◆ initLocale()

void QCoreApplicationPrivate::initLocale ( )
static

Definition at line 614 of file qcoreapplication.cpp.

References at, dot(), Q_LIKELY, qstrcmp(), qstricmp(), and qWarning.

Referenced by Q_TRACE_INSTRUMENT().

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

◆ isTranslatorInstalled()

bool QCoreApplicationPrivate::isTranslatorInstalled ( QTranslator * translator)
static

Definition at line 2393 of file qcoreapplication.cpp.

References d.

Referenced by QTranslatorPrivate::clear().

+ Here is the caller graph for this function:

◆ lockThreadPostEventList()

QCoreApplicationPrivate::QPostEventListLocker QCoreApplicationPrivate::lockThreadPostEventList ( QObject * object)
static

Definition at line 1617 of file qcoreapplication.cpp.

References QThreadData::current(), QObjectPrivate::get(), QCoreApplicationPrivate::QPostEventListLocker::locker, QPostEventList::mutex, QThreadData::postEventList, Q_ASSERT, and QCoreApplicationPrivate::QPostEventListLocker::threadData.

Referenced by QObject::deleteLater(), QCoreApplication::postEvent(), and QCoreApplication::removePostedEvents().

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

◆ mainThread()

QThread * QCoreApplicationPrivate::mainThread ( )
static

Definition at line 529 of file qcoreapplication.cpp.

References Q_ASSERT, and theMainThread.

Referenced by QFactoryLoader::QFactoryLoader(), QThreadPrivate::createEventDispatcher(), QFactoryLoader::instance(), QCoreApplication::notify(), and QApplicationPrivate::notify_helper().

+ Here is the caller graph for this function:

◆ notify_helper()

bool QCoreApplicationPrivate::notify_helper ( QObject * receiver,
QEvent * event )
static

Helper function called by QCoreApplicationPrivate::notify() and qapplication.cpp

Definition at line 1305 of file qcoreapplication.cpp.

References QObject::event(), mainThread, Q_TRACE, Q_TRACE_EXIT, and QObject::thread().

Referenced by doNotify().

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

◆ processCommandLineArguments()

void QCoreApplicationPrivate::processCommandLineArguments ( )

Definition at line 213 of file qcoreapplication.cpp.

References arg, argc, argv, QString::fromLocal8Bit(), i, j, and qmljs_debug_arguments.

Referenced by Q_TRACE_INSTRUMENT().

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

◆ qmljsDebugArgumentsString()

QString QCoreApplicationPrivate::qmljsDebugArgumentsString ( ) const
inline

Definition at line 170 of file qcoreapplication_p.h.

◆ quit()

void QCoreApplicationPrivate::quit ( )
virtual

Reimplemented in QGuiApplicationPrivate.

Definition at line 2175 of file qcoreapplication.cpp.

References QThread::currentThread(), mainThread, QCoreApplication::postEvent(), QEvent::Quit, and QCoreApplication::sendEvent().

Referenced by QGuiApplicationPrivate::quit().

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

◆ quitAutomatically()

void QCoreApplicationPrivate::quitAutomatically ( )

Definition at line 2117 of file qcoreapplication.cpp.

References QCoreApplication::postEvent(), and QEvent::Quit.

Referenced by QGuiApplicationPrivate::maybeLastWindowClosed().

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

◆ ref()

void QCoreApplicationPrivate::ref ( )

Definition at line 2087 of file qcoreapplication.cpp.

◆ removePostedEvent()

void QCoreApplicationPrivate::removePostedEvent ( QEvent * event)
static

Removes event from the queue of posted events, and emits a warning message if appropriate.

Warning
This function can be really slow. Avoid using it, if possible.

\threadsafe

Definition at line 2041 of file qcoreapplication.cpp.

References QThreadData::current(), qDebug, and qWarning.

Referenced by QEvent::~QEvent().

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

◆ sendPostedEvents()

void QCoreApplicationPrivate::sendPostedEvents ( QObject * receiver,
int event_type,
QThreadData * data )
static

Definition at line 1790 of file qcoreapplication.cpp.

References QSet< T >::begin(), QEvent::DeferredDelete, i, it, Q_ASSERT, qCDebug, qScopeGuard(), qWarning, and QCoreApplication::sendEvent().

Referenced by QEventDispatcherUNIX::processEvents(), QEventDispatcherWin32::sendPostedEvents(), and QCoreApplication::sendPostedEvents().

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

◆ sendThroughApplicationEventFilters()

bool QCoreApplicationPrivate::sendThroughApplicationEventFilters ( QObject * receiver,
QEvent * event )

Definition at line 1258 of file qcoreapplication.cpp.

References i, mainThread, Q_ASSERT, qWarning, and QObject::thread().

Referenced by QApplicationPrivate::notify_helper().

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

◆ sendThroughObjectEventFilters()

bool QCoreApplicationPrivate::sendThroughObjectEventFilters ( QObject * receiver,
QEvent * event )
static

Definition at line 1280 of file qcoreapplication.cpp.

References i, QCoreApplication::instance(), mainThread, qWarning, and QObject::thread().

Referenced by QApplicationPrivate::notify_helper().

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

◆ setApplicationFilePath()

void QCoreApplicationPrivate::setApplicationFilePath ( const QString & path)
static

Definition at line 2423 of file qcoreapplication.cpp.

References cachedApplicationFilePath.

Referenced by QCoreApplication::applicationFilePath().

+ Here is the caller graph for this function:

◆ setEventSpontaneous()

static void QCoreApplicationPrivate::setEventSpontaneous ( QEvent * e,
bool spontaneous )
inlinestatic

Definition at line 94 of file qcoreapplication_p.h.

Referenced by QWidgetWindow::handleMouseEvent(), and QApplicationPrivate::notify_helper().

+ Here is the caller graph for this function:

◆ testAttribute()

static bool QCoreApplicationPrivate::testAttribute ( uint flag)
inlinestatic

Definition at line 166 of file qcoreapplication_p.h.

Referenced by QWidget::create(), QApplicationPrivate::handlePaletteChanged(), QApplicationPrivate::setActiveWindow(), and QCoreApplication::testAttribute().

+ Here is the caller graph for this function:

◆ threadRequiresCoreApplication()

bool QCoreApplicationPrivate::threadRequiresCoreApplication ( )
static

Definition at line 535 of file qcoreapplication.cpp.

References QThreadData::current().

Referenced by QEventLoop::QEventLoop(), and QApplicationPrivate::notify_helper().

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

Member Data Documentation

◆ aboutToQuitEmitted

bool QCoreApplicationPrivate::aboutToQuitEmitted

Definition at line 156 of file qcoreapplication_p.h.

Referenced by QWindowsContext::windowsProc().

◆ application_type

◆ argc

◆ argv

◆ attribs

Q_CONSTINIT uint QCoreApplicationPrivate::attribs
static
Initial value:

Definition at line 165 of file qcoreapplication_p.h.

Referenced by QCoreApplication::setAttribute().

◆ cachedApplicationDirPath

QString QCoreApplicationPrivate::cachedApplicationDirPath

Definition at line 147 of file qcoreapplication_p.h.

◆ cachedApplicationFilePath

Q_CONSTINIT QString * QCoreApplicationPrivate::cachedApplicationFilePath = nullptr
static

◆ eventDispatcher

◆ in_exec

bool QCoreApplicationPrivate::in_exec

Definition at line 155 of file qcoreapplication_p.h.

Referenced by QGuiApplicationPrivate::maybeLastWindowClosed().

◆ is_app_closing

◆ is_app_running

◆ qmljs_debug_arguments

QString QCoreApplicationPrivate::qmljs_debug_arguments

Definition at line 169 of file qcoreapplication_p.h.

Referenced by processCommandLineArguments().

◆ quitLockRef

QAtomicInt QCoreApplicationPrivate::quitLockRef

Definition at line 103 of file qcoreapplication_p.h.

◆ setuidAllowed

Q_CONSTINIT bool QCoreApplicationPrivate::setuidAllowed = false
static

◆ theMainThread

◆ theMainThreadId

Q_CONSTINIT QBasicAtomicPointer< void > QCoreApplicationPrivate::theMainThreadId = Q_BASIC_ATOMIC_INITIALIZER(nullptr)
static

Definition at line 111 of file qcoreapplication_p.h.

Referenced by QThreadData::~QThreadData(), and QThreadData::current().

◆ threadData_clean

bool QCoreApplicationPrivate::threadData_clean

Definition at line 157 of file qcoreapplication_p.h.

Referenced by cleanupThreadData().

◆ translateMutex

QReadWriteLock QCoreApplicationPrivate::translateMutex

Definition at line 141 of file qcoreapplication_p.h.

◆ translators

QTranslatorList QCoreApplicationPrivate::translators

Definition at line 140 of file qcoreapplication_p.h.


The documentation for this class was generated from the following files: