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.h File Reference

(60c2d72d967402ff057e15eeceda4b40560b4ad2)

#include <QtCore/qglobal.h>
#include <QtCore/qstring.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qdeadlinetimer.h>
#include <QtCore/qeventloop.h>
#include <QtCore/qobject.h>
#include <QtCore/qnativeinterface.h>
#include <QtCore/qdebug.h>
#include <QtCore/qcoreapplication_platform.h>
+ Include dependency graph for qcoreapplication.h:

Go to the source code of this file.

Classes

class  QCoreApplication
 \inmodule QtCore More...
 

Macros

#define qApp   QCoreApplication::instance()
 
#define Q_DECLARE_TR_FUNCTIONS(context)
 
#define Q_COREAPP_STARTUP_FUNCTION(AFUNC)
 

Typedefs

typedef void(* QtStartUpFunction) ()
 
typedef void(* QtCleanUpFunction) ()
 

Functions

Q_CORE_EXPORT void qAddPreRoutine (QtStartUpFunction)
 
Q_CORE_EXPORT void qAddPostRoutine (QtCleanUpFunction)
 
Q_CORE_EXPORT void qRemovePostRoutine (QtCleanUpFunction)
 
Q_CORE_EXPORT QString qAppName ()
 

Macro Definition Documentation

◆ Q_COREAPP_STARTUP_FUNCTION

#define Q_COREAPP_STARTUP_FUNCTION ( AFUNC)
Value:
static void AFUNC ## _ctor_function() { \
qAddPreRoutine(AFUNC); \
} \
Q_CONSTRUCTOR_FUNCTION(AFUNC ## _ctor_function)

Definition at line 264 of file qcoreapplication.h.

◆ Q_DECLARE_TR_FUNCTIONS

#define Q_DECLARE_TR_FUNCTIONS ( context)
Value:
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
private:
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static void * context
GLfloat n
#define tr(X)

Definition at line 250 of file qcoreapplication.h.

◆ qApp

#define qApp   QCoreApplication::instance()

Definition at line 42 of file qcoreapplication.h.

Referenced by src_gui_kernel_qguiapplication::MyMainWidget::MyMainWidget(), QAndroidCameraSession::QAndroidCameraSession(), QAndroidPlatformIntegration::QAndroidPlatformIntegration(), QDBusBlockingCallWatcher::QDBusBlockingCallWatcher(), QFontComboBox::QFontComboBox(), QIBusPlatformInputContext::QIBusPlatformInputContext(), QIOSTextInputOverlay::QIOSTextInputOverlay(), QLoggingRegistry::QLoggingRegistry(), QQmlDebugConnectorParams::QQmlDebugConnectorParams(), QQuickSystemPalette::QQuickSystemPalette(), QQuickTapHandler::QQuickTapHandler(), QSessionManagerPrivate::QSessionManagerPrivate(), QTipLabel::QTipLabel(), QtWaylandClient::QWaylandSurface::QWaylandSurface(), QWaylandTextInput::QWaylandTextInput(), QWhatsThisPrivate::QWhatsThisPrivate(), QWidgetPrivate::QWidgetPrivate(), QXcbIntegration::QXcbIntegration(), QAction::~QAction(), QGraphicsScene::~QGraphicsScene(), QIOSTextInputOverlay::~QIOSTextInputOverlay(), QShortcut::~QShortcut(), QWidget::~QWidget(), __attribute__(), QCalendarWidgetPrivate::_q_yearClicked(), QCalendarWidgetPrivate::_q_yearEditingFinished(), QIcon::actualSize(), QFontDatabasePrivate::addAppFont(), QTestResult::addFailure(), QIcon::addFile(), QWaylandInputMethodEventBuilder::addPreeditStyling(), androidCheckPermission(), QX11Info::appRootWindow(), QX11Info::appScreen(), QX11Info::appTime(), QX11Info::appUserTime(), QDBusConnectionManager::busConnection(), QQuickIconImagePrivate::calculateDevicePixelRatio(), QWidget::changeEvent(), QQuickWindowPrivate::clearGrabbers(), QIBusPlatformInputContext::commit(), QIBusPlatformInputContext::commitText(), QX11Info::connection(), QDBusConnectionManager::connectToBus(), createAnimationBuffer(), QtAndroidQuickViewEmbedding::createQuickView(), QtAndroidWindowEmbedding::createRootWindow(), QIBusPlatformInputContext::cursorRectChanged(), QKeySequencePrivate::decodeString(), QObject::deleteLater(), QIBusPlatformInputContext::deleteSurroundingText(), QEventLoopPrivate::deref(), QWidget::destroy(), QQuickFlickablePrivate::devicePixelRatio(), QQuickTextPrivate::devicePixelRatio(), QApplicationPrivate::dispatchEnterLeave(), QX11Info::display(), AVFDisplayLink::displayLinkEvent(), dpr(), QQuickDeliveryAgentPrivate::dragOverThreshold(), QQuickPointerHandlerPrivate::dragOverThreshold(), QQuickDeliveryAgentPrivate::dragOverThreshold(), QQuickPointerHandler::dragThreshold(), QMacStyle::drawControl(), QKeySequencePrivate::encodeString(), QQuickShapeGenericRenderer::endSync(), ensureAndroidPermission(), ensureAuthorizationDialogNotBlocked(), QMenuBar::eventFilter(), QQuickMenuBar::eventFilter(), QGraphicsScene::eventFilter(), QComposeInputContext::filterEvent(), QWidget::focusOutEvent(), focusView(), QIBusPlatformInputContext::forwardKeyEvent(), QX11Info::generatePeekerId(), QX11Info::getTimestamp(), QWidget::grabShortcut(), QGraphicsWidget::grabShortcut(), QDBusConnectionPrivate::handleMessage(), QQuickAbstractButtonPrivate::handleRelease(), QWindowSystemInterface::handleScreenRemoved(), QWidgetPrivate::handleSoftwareInputPanel(), AndroidPositioning::hasPositioningPermissions(), hasRecordPermission(), QCommandLineParserPrivate::helpText(), QWidgetPrivate::hide_helper(), QWidgetPrivate::hideChildren(), QWidgetPrivate::inheritStyle(), QGraphicsScenePrivate::init(), QQuickWindowPrivate::init(), QWidgetPrivate::init(), initializeRHI(), QGestureManager::instance(), QtAndroidAccessibility::interfaceFromId(), QtAndroidAccessibility::invokeActionOnInterfaceInMainThread(), isAutoDiskCacheEnabled(), QWidgetPlatform::isAvailable(), QX11Info::isCompositingManagerRunning(), isDprScaling(), QAndroidPlatformWindow::isExposed(), QIOSWindow::isExposed(), QPrinter::isValid(), jump(), QCocoaTheme::keyBindings(), QLowEnergyControllerPrivateDarwin::lazyInit(), QQuickAnimatedImage::load(), QPixmap::load(), QQuickImageBase::loadPixmap(), QTextDocument::loadResource(), QOpenGLContext::makeCurrent(), QSSGLayerRenderData::maybeBakeLightmap(), QtQuickTest::mouseEvent(), QTest::mouseEvent(), QX11Info::nextStartupId(), QMacPageSetupDialogPrivate::openCocoaPageLayout(), QPrintDialogPrivate::openCocoaPrintPanel(), QPixmapIconEngine::paint(), QX11Info::peekEventQueue(), PixmapEntry::pixmap(), QIcon::pixmap(), QWindowsVistaStyle::polish(), populateLightSystemBasePalette(), QGuiApplicationPrivate::processFileOpenEvent(), QGuiApplicationPrivate::processFocusWindowEvent(), QEvdevKeyboardHandler::processKeycode(), QGuiApplicationPrivate::processMouseEvent(), QGuiApplicationPrivate::processTabletEvent(), QGuiApplicationPrivate::processTouchEvent(), Q_LOGGING_CATEGORY(), Q_TRACE_INSTRUMENT(), QTest::qFindTestData(), QTest::qInit(), qRequireVersion(), QTest::qRun(), qt_filterEvent(), qt_getDevicePixelRatio(), qt_painter_thread_test(), qt_pixmap_thread_test(), QGraphicsWidget::releaseShortcut(), QWidget::releaseShortcut(), QX11Info::removePeekerId(), QAlphaWidget::render(), QLineEditPrivate::resetInputMethod(), QtAndroidWindowEmbedding::resizeWindow(), QAlphaWidget::run(), QPixmapIconEngine::scaledPixmap(), QWaylandTextInputPrivate::sendInputPanelState(), QTest::sendKeyEvent(), QWaylandTextInputPrivate::sendLocale(), QWaylandTextInputPrivate::sendTextDirection(), QLowEnergyService::serviceName(), QAndroidCameraSession::setActive(), QWindowsIntegration::setApplicationBadge(), QGuiApplicationPrivate::setApplicationState(), QX11Info::setAppTime(), QX11Info::setAppUserTime(), QCoreApplication::setAttribute(), QQuickTextControlPrivate::setBlinkingCursorEnabled(), QQuickTextInputPrivate::setBlinkingCursorEnabled(), QQuickContext2DTexture::setCanvasWindow(), QSurfaceFormat::setDefaultFormat(), QWaylandTextInputPrivate::setFocus(), QWaylandTextInputV3Private::setFocus(), QGraphicsScenePrivate::setFocusItemHelper(), QApplicationPrivate::setFocusWidget(), QX11Info::setNextStartupId(), QPlatformInputContext::setSelectionOnFocusObject(), QWidget::setShortcutAutoRepeat(), QGraphicsWidget::setShortcutAutoRepeat(), QWidget::setShortcutEnabled(), QGraphicsWidget::setShortcutEnabled(), QQuickAnimatedSprite::setSource(), QWidget::setStyle(), QWindowPrivate::setVisible(), QCocoaWindow::setVisible(), QWidgetPrivate::setVisible(), QtAndroidWindowEmbedding::setWindowVisible(), QWidgetPrivate::show_helper(), QComboBox::showPopup(), QTest::simulateEvent(), QAndroidStyle::sizeFromContents(), QMessageBoxPrivate::standardIcon(), QMacStyle::standardPixmap(), QQC2::styleCacheImage(), QQC2::styleCachePixmap(), QWaylandQtTextInputMethodPrivate::text_input_method_v1_commit(), QWaylandQtTextInputMethodPrivate::text_input_method_v1_hide_input_panel(), QWaylandQtTextInputMethodPrivate::text_input_method_v1_invoke_action(), QWaylandQtTextInputMethodPrivate::text_input_method_v1_reset(), QWaylandQtTextInputMethodPrivate::text_input_method_v1_show_input_panel(), ImeState::update(), QInputMethod::update(), QIBusPlatformInputContext::update(), QIBusPlatformInputContext::updatePreeditText(), QQuickTableViewResizeHandler::updateState(), QTest::wheelEvent(), QWindowsContext::windowsProc(), QWaylandTextInputPrivate::zwp_text_input_v2_hide_input_panel(), QWaylandTextInputPrivate::zwp_text_input_v2_show_input_panel(), QWaylandTextInputPrivate::zwp_text_input_v2_update_state(), QWaylandTextInputV3Private::zwp_text_input_v3_commit(), QWaylandTextInputV3Private::zwp_text_input_v3_disable(), and QWaylandTextInputV3Private::zwp_text_input_v3_enable().

Typedef Documentation

◆ QtCleanUpFunction

typedef void(* QtCleanUpFunction) ()

Definition at line 257 of file qcoreapplication.h.

◆ QtStartUpFunction

typedef void(* QtStartUpFunction) ()

Definition at line 256 of file qcoreapplication.h.

Function Documentation

◆ qAddPostRoutine()

◆ qAddPreRoutine()

Q_CORE_EXPORT 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:

◆ qAppName()

Q_CORE_EXPORT QString qAppName ( )

Definition at line 246 of file qcoreapplication.cpp.

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

+ Here is the caller graph for this function:

◆ qRemovePostRoutine()

Q_CORE_EXPORT 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: