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
qguiapplication.cpp File Reference

(1f667ba70e91563c2b508a70291fdac8a814c150)

#include "qguiapplication.h"
#include "private/qguiapplication_p.h"
#include "private/qabstractfileiconprovider_p.h"
#include <qpa/qplatformintegrationfactory_p.h>
#include "private/qevent_p.h"
#include "private/qeventpoint_p.h"
#include "private/qiconloader_p.h"
#include "qfont.h"
#include "qpointingdevice.h"
#include <qpa/qplatformfontdatabase.h>
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformtheme.h>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformkeymapper.h>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QFileInfo>
#include <QtCore/QStandardPaths>
#include <QtCore/QVariant>
#include <QtCore/private/qcoreapplication_p.h>
#include <QtCore/private/qabstracteventdispatcher_p.h>
#include <QtCore/private/qminimalflatset_p.h>
#include <QtCore/qmutex.h>
#include <QtCore/private/qthread_p.h>
#include <QtCore/private/qlocking_p.h>
#include <QtCore/private/qflatmap_p.h>
#include <QtCore/qdir.h>
#include <QtCore/qlibraryinfo.h>
#include <QtCore/private/qnumeric_p.h>
#include <QtDebug>
#include <qpalette.h>
#include <qscreen.h>
#include "qsessionmanager.h"
#include <private/qcolortrclut_p.h>
#include <private/qscreen_p.h>
#include <QtGui/qgenericpluginfactory.h>
#include <QtGui/qstylehints.h>
#include <QtGui/private/qstylehints_p.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/qpixmapcache.h>
#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatforminputcontext_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qwindowsysteminterface_p.h>
#include "private/qwindow_p.h"
#include "private/qicon_p.h"
#include "private/qcursor_p.h"
#include "private/qinputdevicemanager_p.h"
#include "private/qinputmethod_p.h"
#include "private/qpointingdevice_p.h"
#include <qpa/qplatformthemefactory_p.h>
#include <qpa/qplatformcursor.h>
#include <QtGui/QPixmap>
#include <QtGui/QClipboard>
#include <qtgui_tracepoints_p.h>
#include <private/qtools_p.h>
#include <limits>
#include "moc_qguiapplication.cpp"

Go to the source code of this file.

Classes

struct  QWindowGeometrySpecification
 

Macros

#define CHECK_QAPP_INSTANCE(...)
 
#define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER   { Qt::TopLeftCorner, -1, -1, -1, -1 }
 

Enumerations

enum  ApplicationResourceFlags { ApplicationFontExplicitlySet = 0x2 }
 
enum  MouseMasks {
  MouseCapsMask = 0xFF , MouseSourceMaskDst = 0xFF00 , MouseSourceMaskSrc = MouseCapsMask , MouseSourceShift = 8 ,
  MouseFlagsCapsMask = 0xFF0000 , MouseFlagsShift = 16
}
 

Functions

Q_CORE_EXPORT void qt_call_post_routines ()
 
void qRegisterGuiVariant ()
 
static bool qt_detectRTLLanguage ()
 
static void initFontUnlocked ()
 
static void clearFontUnlocked ()
 
static void initThemeHints ()
 
static bool checkNeedPortalSupport ()
 
static int nextGeometryToken (const QByteArray &a, int &pos, char *op)
 
static void updateBlockedStatusRecursion (QWindow *window, bool shouldBeBlocked)
 
static bool needsWindowBlockedEvent (const QWindow *w)
 
 Q_LOGGING_CATEGORY (lcQpaPluginLoading, "qt.qpa.plugin")
 
 Q_LOGGING_CATEGORY (lcQpaTheme, "qt.qpa.theme")
 
 Q_LOGGING_CATEGORY (lcPtrDispatch, "qt.pointer.dispatch")
 
static void init_platform (const QString &pluginNamesWithArguments, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)
 
static void init_plugins (const QList< QByteArray > &pluginList)
 
void Q_TRACE_INSTRUMENT (qtgui) QGuiApplicationPrivate
 
void qt_cleanupFontDatabase ()
 
static void applyCursor (QWindow *w, QCursor c)
 
static void unsetCursor (QWindow *w)
 
static void applyCursor (const QList< QWindow * > &l, const QCursor &c)
 
static void applyOverrideCursor (const QList< QScreen * > &screens, const QCursor &c)
 
static void clearOverrideCursor (const QList< QScreen * > &screens)
 
static void applyWindowCursor (const QList< QWindow * > &l)
 

Variables

Q_CONSTINIT Q_GUI_EXPORT bool qt_is_tty_app = false
 
static Q_CONSTINIT unsigned applicationResourceFlags = 0
 
static Q_CONSTINIT int mouseDoubleClickDistance = 0
 
static Q_CONSTINIT int touchDoubleTapDistance = 0
 
static Q_CONSTINIT Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto
 
static Q_CONSTINIT Qt::LayoutDirection effective_layout_direction = Qt::LeftToRight
 
static Q_CONSTINIT bool force_reverse = false
 
static Q_CONSTINIT QBasicMutex applicationFontMutex
 
static Q_CONSTINIT qreal fontSmoothingGamma = 1.7
 
static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER
 

Macro Definition Documentation

◆ CHECK_QAPP_INSTANCE

#define CHECK_QAPP_INSTANCE ( ...)
Value:
} else { \
qWarning("Must construct a QGuiApplication first."); \
return __VA_ARGS__; \
}
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
#define Q_LIKELY(x)

Definition at line 114 of file qguiapplication.cpp.

Referenced by QGuiApplication::changeOverrideCursor(), QApplicationPrivate::desktop(), QGuiApplication::inputMethod(), QApplication::isEffectEnabled(), QGuiApplication::modalWindow(), QGuiApplication::overrideCursor(), QGuiApplication::queryKeyboardModifiers(), QGuiApplication::restoreOverrideCursor(), and QGuiApplication::setOverrideCursor().

◆ Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER

#define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER   { Qt::TopLeftCorner, -1, -1, -1, -1 }

Definition at line 246 of file qguiapplication.cpp.

Referenced by QWindowGeometrySpecification::fromArgument().

Enumeration Type Documentation

◆ ApplicationResourceFlags

Enumerator
ApplicationFontExplicitlySet 

Definition at line 147 of file qguiapplication.cpp.

◆ MouseMasks

enum MouseMasks
Enumerator
MouseCapsMask 
MouseSourceMaskDst 
MouseSourceMaskSrc 
MouseSourceShift 
MouseFlagsCapsMask 
MouseFlagsShift 

Definition at line 4355 of file qguiapplication.cpp.

Function Documentation

◆ applyCursor() [1/2]

static void applyCursor ( const QList< QWindow * > & l,
const QCursor & c )
inlinestatic

Definition at line 4121 of file qguiapplication.cpp.

References applyCursor(), Qt::Desktop, and i.

+ Here is the call graph for this function:

◆ applyCursor() [2/2]

static void applyCursor ( QWindow * w,
QCursor c )
inlinestatic

Definition at line 4107 of file qguiapplication.cpp.

References cursor, QPlatformScreen::cursor(), QScreen::handle(), and screen.

Referenced by applyCursor(), applyWindowCursor(), QGuiApplication::restoreOverrideCursor(), and QGuiApplication::setOverrideCursor().

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

◆ applyOverrideCursor()

static void applyOverrideCursor ( const QList< QScreen * > & screens,
const QCursor & c )
inlinestatic

Definition at line 4130 of file qguiapplication.cpp.

References cursor, QPlatformScreen::cursor(), QScreen::handle(), and screen.

Referenced by QGuiApplication::restoreOverrideCursor(), and QGuiApplication::setOverrideCursor().

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

◆ applyWindowCursor()

static void applyWindowCursor ( const QList< QWindow * > & l)
inlinestatic

Definition at line 4146 of file qguiapplication.cpp.

References applyCursor(), Qt::Desktop, i, qt_window_private(), and unsetCursor().

Referenced by QGuiApplication::restoreOverrideCursor().

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

◆ checkNeedPortalSupport()

static bool checkNeedPortalSupport ( )
static

Definition at line 236 of file qguiapplication.cpp.

References QFileInfo::exists(), and qEnvironmentVariableIsSet().

Referenced by init_platform().

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

◆ clearFontUnlocked()

static void clearFontUnlocked ( )
inlinestatic

Definition at line 224 of file qguiapplication.cpp.

References QGuiApplicationPrivate::app_font.

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

+ Here is the caller graph for this function:

◆ clearOverrideCursor()

static void clearOverrideCursor ( const QList< QScreen * > & screens)
inlinestatic

Definition at line 4138 of file qguiapplication.cpp.

References cursor, QPlatformScreen::cursor(), QScreen::handle(), and screen.

Referenced by QGuiApplication::restoreOverrideCursor().

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

◆ init_platform()

static void init_platform ( const QString & pluginNamesWithArguments,
const QString & platformPluginPath,
const QString & platformThemeName,
int & argc,
char ** argv )
static

◆ init_plugins()

static void init_plugins ( const QList< QByteArray > & pluginList)
static

Definition at line 1359 of file qguiapplication.cpp.

References QByteArray::at(), QGenericPluginFactory::create(), QGuiApplicationPrivate::generic_plugin_list, i, and qWarning.

Referenced by Q_TRACE_INSTRUMENT().

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

◆ initFontUnlocked()

static void initFontUnlocked ( )
static

Definition at line 212 of file qguiapplication.cpp.

References QGuiApplicationPrivate::app_font, font, QGuiApplicationPrivate::platformIntegration(), QGuiApplicationPrivate::platformTheme(), and QPlatformTheme::SystemFont.

Referenced by QGuiApplication::font(), and QGuiApplicationPrivate::handleThemeChanged().

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

◆ initThemeHints()

static void initThemeHints ( )
static

Definition at line 230 of file qguiapplication.cpp.

References mouseDoubleClickDistance, QPlatformTheme::MouseDoubleClickDistance, QGuiApplicationPrivate::platformTheme(), touchDoubleTapDistance, and QPlatformTheme::TouchDoubleTapDistance.

Referenced by QGuiApplicationPrivate::handleThemeChanged(), and Q_TRACE_INSTRUMENT().

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

◆ needsWindowBlockedEvent()

static bool needsWindowBlockedEvent ( const QWindow * w)
inlinestatic

Definition at line 861 of file qguiapplication.cpp.

References Qt::Desktop.

Referenced by QGuiApplicationPrivate::hideModalWindow(), and QGuiApplicationPrivate::showModalWindow().

+ Here is the caller graph for this function:

◆ nextGeometryToken()

static int nextGeometryToken ( const QByteArray & a,
int & pos,
char * op )
inlinestatic

Definition at line 263 of file qguiapplication.cpp.

References QtMiscUtils::isAsciiDigit(), ok, and pos.

Referenced by QWindowGeometrySpecification::fromArgument().

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

◆ Q_LOGGING_CATEGORY() [1/3]

Q_LOGGING_CATEGORY ( lcPtrDispatch ,
"qt.pointer.dispatch"  )

◆ Q_LOGGING_CATEGORY() [2/3]

Q_LOGGING_CATEGORY ( lcQpaPluginLoading ,
"qt.qpa.plugin"  )

◆ Q_LOGGING_CATEGORY() [3/3]

Q_LOGGING_CATEGORY ( lcQpaTheme ,
"qt.qpa.theme"  )

◆ Q_TRACE_INSTRUMENT()

void Q_TRACE_INSTRUMENT ( qtgui )

◆ qRegisterGuiVariant()

void qRegisterGuiVariant ( )
extern

Definition at line 142 of file qguivariant.cpp.

References qMetaTypeGuiHelper.

Referenced by Q_TRACE_INSTRUMENT().

+ Here is the caller graph for this function:

◆ qt_call_post_routines()

Q_CORE_EXPORT void qt_call_post_routines ( )

Definition at line 320 of file qcoreapplication.cpp.

◆ qt_cleanupFontDatabase()

void qt_cleanupFontDatabase ( )
extern

Definition at line 518 of file qfontdatabase.cpp.

References db, and QFontDatabasePrivate::instance().

Referenced by QGuiApplicationPrivate::~QGuiApplicationPrivate().

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

◆ qt_detectRTLLanguage()

static bool qt_detectRTLLanguage ( )
static

Definition at line 203 of file qguiapplication.cpp.

References force_reverse.

Referenced by QGuiApplication::setLayoutDirection().

+ Here is the caller graph for this function:

◆ unsetCursor()

static void unsetCursor ( QWindow * w)
inlinestatic

Definition at line 4114 of file qguiapplication.cpp.

References cursor, QPlatformScreen::cursor(), QScreen::handle(), and screen.

Referenced by applyWindowCursor(), QHeaderView::mouseMoveEvent(), and QQuickPageIndicator::setInteractive().

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

◆ updateBlockedStatusRecursion()

static void updateBlockedStatusRecursion ( QWindow * window,
bool shouldBeBlocked )
static

Definition at line 835 of file qguiapplication.cpp.

References qt_window_private(), QCoreApplication::sendEvent(), updateBlockedStatusRecursion(), window(), QEvent::WindowBlocked, and QEvent::WindowUnblocked.

Referenced by QGuiApplicationPrivate::updateBlockedStatus(), and updateBlockedStatusRecursion().

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

Variable Documentation

◆ applicationFontMutex

Q_CONSTINIT QBasicMutex applicationFontMutex
static

◆ applicationResourceFlags

Q_CONSTINIT unsigned applicationResourceFlags = 0
static

◆ effective_layout_direction

Q_CONSTINIT Qt::LayoutDirection effective_layout_direction = Qt::LeftToRight
static

Definition at line 170 of file qguiapplication.cpp.

Referenced by QGuiApplication::setLayoutDirection().

◆ fontSmoothingGamma

Q_CONSTINIT qreal fontSmoothingGamma = 1.7
static

◆ force_reverse

Q_CONSTINIT bool force_reverse = false
static

Definition at line 171 of file qguiapplication.cpp.

Referenced by Q_TRACE_INSTRUMENT(), and qt_detectRTLLanguage().

◆ layout_direction

◆ mouseDoubleClickDistance

Q_CONSTINIT int mouseDoubleClickDistance = 0
static

◆ qt_is_tty_app

◆ touchDoubleTapDistance

Q_CONSTINIT int touchDoubleTapDistance = 0
static

◆ windowGeometrySpecification