7#include "private/qguiapplication_p.h"
8#include "private/qabstractfileiconprovider_p.h"
9#include <qpa/qplatformintegrationfactory_p.h>
10#include "private/qevent_p.h"
11#include "private/qeventpoint_p.h"
12#include "private/qiconloader_p.h"
15#include <qpa/qplatformfontdatabase.h>
16#include <qpa/qplatformwindow.h>
17#include <qpa/qplatformnativeinterface.h>
18#include <qpa/qplatformtheme.h>
19#include <qpa/qplatformintegration.h>
21#include <QtCore/QAbstractEventDispatcher>
22#include <QtCore/QFileInfo>
23#include <QtCore/QStandardPaths>
24#include <QtCore/QVariant>
25#include <QtCore/private/qcoreapplication_p.h>
26#include <QtCore/private/qabstracteventdispatcher_p.h>
27#include <QtCore/qmutex.h>
28#include <QtCore/private/qthread_p.h>
29#include <QtCore/private/qlocking_p.h>
30#include <QtCore/private/qflatmap_p.h>
31#include <QtCore/qdir.h>
32#include <QtCore/qlibraryinfo.h>
33#include <QtCore/private/qnumeric_p.h>
35#if QT_CONFIG(accessibility)
41#include <private/qcolortrclut_p.h>
42#include <private/qscreen_p.h>
44#include <QtGui/qgenericpluginfactory.h>
45#include <QtGui/qstylehints.h>
46#include <QtGui/private/qstylehints_p.h>
47#include <QtGui/qinputmethod.h>
48#include <QtGui/qpixmapcache.h>
49#include <qpa/qplatforminputcontext.h>
50#include <qpa/qplatforminputcontext_p.h>
52#include <qpa/qwindowsysteminterface.h>
53#include <qpa/qwindowsysteminterface_p.h>
54#include "private/qwindow_p.h"
55#include "private/qicon_p.h"
56#include "private/qcursor_p.h"
58# include "private/qopenglcontext_p.h"
60#include "private/qinputdevicemanager_p.h"
61#include "private/qinputmethod_p.h"
62#include "private/qpointingdevice_p.h"
64#include <qpa/qplatformthemefactory_p.h>
66#if QT_CONFIG(draganddrop)
67#include <qpa/qplatformdrag.h>
68#include <private/qdnd_p.h>
72#include <qpa/qplatformcursor.h>
75#include <QtGui/QPixmap>
77#ifndef QT_NO_CLIPBOARD
78#include <QtGui/QClipboard>
82#include <QtCore/QLibrary>
86# include "private/qcore_mac_p.h"
87#elif defined(Q_OS_WIN)
88# include <QtCore/qt_windows.h>
89# include <QtCore/QLibraryInfo>
93#include <emscripten.h>
97#include <private/qvulkandefaultinstance_p.h>
100#include <qtgui_tracepoints_p.h>
102#include <private/qtools_p.h>
112#define CHECK_QAPP_INSTANCE(...) \
113 if (Q_LIKELY(QCoreApplication::instance())) { \
115 qWarning("Must construct a QGuiApplication first."); \
116 return __VA_ARGS__; \
172Q_CONSTINIT
int QGuiApplicationPrivate::m_fakeMouseSourcePointId = -1;
174#ifndef QT_NO_CLIPBOARD
190Q_CONSTINIT
qreal QGuiApplicationPrivate::m_maxDevicePixelRatio = 0.0;
197#if QT_CONFIG(animation)
204 (QGuiApplication::tr(
"QT_LAYOUT_DIRECTION",
205 "Translate this string to the string 'LTR' in left-to-right"
206 " languages or to 'RTL' in right-to-left languages (such as Hebrew"
207 " and Arabic) to get proper widget layout.") ==
"RTL"_L1);
244#define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER { Qt::TopLeftCorner, -1, -1, -1, -1 }
269 if (*op ==
'+' || *op ==
'-' || *op ==
'x')
276 const int numberPos =
pos;
280 const int result =
a.mid(numberPos,
pos - numberPos).toInt(&
ok);
288 for (
int i = 0;
i < 4; ++
i) {
299 if (
result.xOffset >= 0) {
318 const QSize windowMinimumSize =
window->minimumSize();
319 const QSize windowMaximumSize =
window->maximumSize();
327 const QRect availableGeometry =
window->screen()->virtualGeometry();
339 window->setFramePosition(topLeft);
663 d->eventDispatcher->closingDown();
664 d->eventDispatcher =
nullptr;
666#ifndef QT_NO_CLIPBOARD
671#ifndef QT_NO_SESSIONMANAGER
672 delete d->session_manager;
673 d->session_manager =
nullptr;
676 QGuiApplicationPrivate::clearPalette();
680 d->cursor_list.clear();
689 delete QGuiApplicationPrivate::m_inputDeviceManager;
690 QGuiApplicationPrivate::m_inputDeviceManager =
nullptr;
706 lastTouchType(
QEvent::TouchEnd),
707 ownGlobalShareContext(
false)
711#ifndef QT_NO_SESSIONMANAGER
800 qWarning(
"QGuiApplication::setDesktopFileName: the specified desktop file name "
801 "ends with .desktop. For compatibility reasons, the .desktop suffix will "
802 "be removed. Please specify a desktop file name without .desktop suffix");
803 (*QGuiApplicationPrivate::desktopFileName).chop(8);
830 if (QGuiApplicationPrivate::self->modalWindowList.isEmpty())
838 if (
p->blockedByModalWindow != shouldBeBlocked) {
839 p->blockedByModalWindow = shouldBeBlocked;
843 if (
c->isWindowType())
851 bool shouldBeBlocked =
false;
873 if (shouldBeBlocked) {
924 *blockingWindow =
nullptr;
934 if (
window == modalWindow || modalWindow->isAncestorOf(
window, QWindow::IncludeTransients))
940 *blockingWindow = modalWindow;
947 if (current->isAncestorOf(modalWindow, QWindow::IncludeTransients)) {
948 *blockingWindow = modalWindow;
951 current = current->parent(QWindow::IncludeTransients);
956 Q_ASSERT_X(
false,
"QGuiApplication",
"internal error, a modal widget cannot be modeless");
1030 if (!
window->isTopLevel())
1041 if (
window->handle() &&
window->handle()->isEmbedded())
1086 if (sibling->geometry().contains(point))
1089 visitedScreens.
append(sibling);
1141 if (!
qFuzzyIsNull(QGuiApplicationPrivate::m_maxDevicePixelRatio))
1142 return QGuiApplicationPrivate::m_maxDevicePixelRatio;
1144 QGuiApplicationPrivate::m_maxDevicePixelRatio = 1.0;
1146 QGuiApplicationPrivate::m_maxDevicePixelRatio =
qMax(QGuiApplicationPrivate::m_maxDevicePixelRatio,
screen->
devicePixelRatio());
1148 return QGuiApplicationPrivate::m_maxDevicePixelRatio;
1153 m_maxDevicePixelRatio = 0.0;
1163 return windowScreen->handle()->topLevelAt(devicePosition);
1213 qCDebug(lcQpaPluginLoading) <<
"init_platform called with"
1214 <<
"pluginNamesWithArguments" << pluginNamesWithArguments
1215 <<
"platformPluginPath" << platformPluginPath
1216 <<
"platformThemeName" << platformThemeName;
1221 for (
const auto &pluginArgument : plugins) {
1230 argumentsKey[0] = argumentsKey.
at(0).
toUpper();
1233 qCDebug(lcQpaPluginLoading) <<
"Attempting to load Qt platform plugin" <<
name <<
"with arguments" <<
arguments;
1238 if (availablePlugins.contains(
name)) {
1239 qCInfo(lcQpaPluginLoading).nospace().noquote()
1240 <<
"Could not load the Qt platform plugin \"" <<
name <<
"\" in \""
1243 qCWarning(lcQpaPluginLoading).nospace().noquote()
1244 <<
"Could not find the Qt platform plugin \"" <<
name <<
"\" in \""
1248 qCDebug(lcQpaPluginLoading) <<
"Successfully loaded Qt platform plugin" <<
name;
1256 QString fatalMessage =
QStringLiteral(
"This application failed to start because no Qt platform plugin could be initialized. "
1257 "Reinstalling the application may fix this problem.\n");
1259 if (!availablePlugins.isEmpty())
1260 fatalMessage +=
"\nAvailable platform plugins are: %1.\n"_L1.
arg(availablePlugins.join(
", "_L1));
1262#if defined(Q_OS_WIN)
1277 if (!platformThemeName.
isEmpty()) {
1278 qCDebug(lcQpaTheme) <<
"Adding" << platformThemeName <<
"from environment to list of theme names";
1284 qCDebug(lcQpaTheme) <<
"Adding xdgdesktopportal to list of theme names";
1290 qCDebug(lcQpaTheme) <<
"Adding platform integration's theme names to list of theme names:" << platformIntegrationThemeNames;
1294 qCDebug(lcQpaTheme) <<
"Attempting to create platform theme" <<
themeName <<
"via QPlatformThemeFactory::create";
1306 qCDebug(lcQpaTheme) <<
"Attempting to create platform theme" <<
themeName <<
"via createPlatformTheme";
1318 qCDebug(lcQpaTheme) <<
"Failed to create platform theme; using \"null\" platform theme";
1324 if (!platformArguments.isEmpty()) {
1332 nativeInterface->setProperty(
name.constData(),
value);
1345 for (
int i = 0;
i < pluginList.
size(); ++
i) {
1361#if QT_CONFIG(commandlineparser)
1364 QCoreApplicationPrivate::addQtOptions(options);
1366#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
1368 const bool x11 = sessionType ==
"x11";
1371 const bool x11 =
false;
1375 QGuiApplication::tr(
"QPA plugin. See QGuiApplication documentation for available options for each plugin."),
QStringLiteral(
"platformName[:options]")));
1377 QGuiApplication::tr(
"Path to the platform plugins."),
QStringLiteral(
"path")));
1379 QGuiApplication::tr(
"Platform theme."),
QStringLiteral(
"theme")));
1381 QGuiApplication::tr(
"Additional plugins to load, can be specified multiple times."),
QStringLiteral(
"plugin")));
1383 QGuiApplication::tr(
"Window geometry for the main window, using the X11-syntax, like 100x100+50+50."),
QStringLiteral(
"geometry")));
1385 QGuiApplication::tr(
"Default window icon."),
QStringLiteral(
"icon")));
1387 QGuiApplication::tr(
"Title of the first window."),
QStringLiteral(
"title")));
1389 QGuiApplication::tr(
"Sets the application's layout direction to Qt::RightToLeft (debugging helper).")));
1391 QGuiApplication::tr(
"Restores the application from an earlier session."),
QStringLiteral(
"session")));
1395 QGuiApplication::tr(
"Display name, overrides $DISPLAY."),
QStringLiteral(
"display")));
1397 QGuiApplication::tr(
"Instance name according to ICCCM 4.1.2.5."),
QStringLiteral(
"name")));
1399 QGuiApplication::tr(
"Disable mouse grabbing (useful in debuggers).")));
1401 QGuiApplication::tr(
"Force mouse grabbing (even when running in a debugger).")));
1403 QGuiApplication::tr(
"ID of the X11 Visual to use."),
QStringLiteral(
"id")));
1406 QGuiApplication::tr(
"Alias for --qwindowgeometry."),
QStringLiteral(
"geometry")));
1408 QGuiApplication::tr(
"Alias for --qwindowicon."),
QStringLiteral(
"icon")));
1410 QGuiApplication::tr(
"Alias for --qwindowtitle."),
QStringLiteral(
"title")));
1424#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
1425 platformName = QT_QPA_DEFAULT_PLATFORM_NAME;
1427#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
1432 const bool isWaylandSessionType =
qgetenv(
"XDG_SESSION_TYPE") ==
"wayland";
1435 const bool defaultIsXcb = platformPluginBase ==
"xcb";
1436 const QByteArray xcbPlatformName = defaultIsXcb ? platformName :
"xcb";
1438 preferredPlatformOrder << xcbPlatformName;
1440 platformName.
clear();
1443 const bool defaultIsWayland = !defaultIsXcb && platformPluginBase.
startsWith(
"wayland");
1444 const QByteArray waylandPlatformName = defaultIsWayland ? platformName :
"wayland";
1445 if (hasWaylandDisplay || isWaylandSessionType) {
1446 preferredPlatformOrder.
prepend(waylandPlatformName);
1448 if (defaultIsWayland)
1449 platformName.
clear();
1453 preferredPlatformOrder.
append(platformName);
1455 platformName = preferredPlatformOrder.join(
';');
1458 bool platformExplicitlySelected =
false;
1460 if (!platformNameEnv.
isEmpty()) {
1461 platformName = platformNameEnv;
1462 platformExplicitlySelected =
true;
1471 int j =
argc ? 1 : 0;
1475 if (*
argv[
i] !=
'-') {
1479 const bool xcbIsDefault = platformName.
startsWith(
"xcb");
1483 if (strcmp(
arg,
"-platformpluginpath") == 0) {
1486 }
else if (strcmp(
arg,
"-platform") == 0) {
1488 platformExplicitlySelected =
true;
1489 platformName =
argv[
i];
1491 }
else if (strcmp(
arg,
"-platformtheme") == 0) {
1494 }
else if (strcmp(
arg,
"-qwindowgeometry") == 0 || (xcbIsDefault && strcmp(
arg,
"-geometry") == 0)) {
1497 }
else if (strcmp(
arg,
"-qwindowtitle") == 0 || (xcbIsDefault && strcmp(
arg,
"-title") == 0)) {
1500 }
else if (strcmp(
arg,
"-qwindowicon") == 0 || (xcbIsDefault && strcmp(
arg,
"-icon") == 0)) {
1514 Q_UNUSED(platformExplicitlySelected);
1520 if (!
icon.isEmpty())
1539 "Creating the platform integration resulted in creating an event dispatcher");
1559#if defined(Q_OS_MACOS)
1567 bool loadTestability =
false;
1570#ifndef QT_NO_SESSIONMANAGER
1573# if defined(Q_OS_WIN)
1574 wchar_t guidstr[40];
1576 CoCreateGuid(&guid);
1577 StringFromGUID2(guid, guidstr, 40);
1579 CoCreateGuid(&guid);
1580 StringFromGUID2(guid, guidstr, 40);
1585 int j =
argc ? 1 : 0;
1589 if (*
argv[
i] !=
'-') {
1596 if (strcmp(
arg,
"-plugin") == 0) {
1598 pluginList <<
argv[
i];
1599 }
else if (strcmp(
arg,
"-reverse") == 0) {
1602 }
else if (strncmp(
arg,
"-psn_", 5) == 0) {
1608 kCFURLPOSIXPathStyle));
1609 if (qbundlePath.
endsWith(
".app"_L1))
1613#ifndef QT_NO_SESSIONMANAGER
1614 }
else if (strcmp(
arg,
"-session") == 0 &&
i <
argc - 1) {
1620 session_key = session_id.
mid(
p +1);
1621 session_id = session_id.
left(
p);
1626 }
else if (strcmp(
arg,
"-testability") == 0) {
1627 loadTestability =
true;
1628 }
else if (strncmp(
arg,
"-style=", 7) == 0) {
1630 }
else if (strcmp(
arg,
"-style") == 0 &&
i <
argc - 1) {
1648 pluginList += envPlugins.
split(
',');
1664#if QT_CONFIG(animation)
1676 ownGlobalShareContext =
true;
1687#ifndef QT_NO_SESSIONMANAGER
1692#if QT_CONFIG(library)
1694 loadTestability =
true;
1696 if (loadTestability) {
1701 typedef void (*TasInitialize)(
void);
1702 TasInitialize initFunction = (TasInitialize)testLib.
resolve(
"qt_testability_init");
1704 qCritical(
"Library qttestability resolve failed!");
1754 if (ownGlobalShareContext) {
1760#if QT_CONFIG(vulkan)
1761 QVulkanDefaultInstance::cleanup();
1780void setOverrideCursor(
const QCursor &);
1781void changeOverrideCursor(
const QCursor &);
1782void restoreOverrideCursor();
1788static void setFont(
const QFont &,
const char *
className =
nullptr);
1791#ifndef QT_NO_CLIPBOARD
1834 return pi->queryKeyboardModifiers();
1863 return pi ?
pi->nativeInterface() :
nullptr;
1874 qWarning(
"QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function");
1878 return pi->nativeInterface() ?
pi->nativeInterface()->platformFunction(
function) :
nullptr;
1906#if QT_CONFIG(accessibility)
1907 QAccessible::setRootObject(
qApp);
1914 if (
e->spontaneous()) {
1922 switch (
e->type()) {
1944#if QT_CONFIG(wheelevent)
1950#if QT_CONFIG(tabletevent)
1970 if (
object->isWindowType()) {
2003 if (!topLevelWindow->handle())
2005 if (!topLevelWindow->close()) {
2028 if (!platformWindow)
2031 if (
event->spontaneous())
2045 Q_TRACE_SCOPE(QGuiApplicationPrivate_processWindowSystemEvent,
e->type);
2137#ifndef QT_NO_GESTURES
2151#ifndef QT_NO_CONTEXTMENU
2161 qWarning() <<
"Unknown user input event type:" <<
e->type;
2187 bool mouseMove =
false;
2188 bool mousePress =
false;
2190 QPointF globalPoint =
e->globalPos;
2193 qWarning(
"QGuiApplicationPrivate::processMouseEvent: Got NaN in mouse position");
2197 type =
e->buttonType;
2205 if (!mouseMove && positionChanged) {
2209 e->source,
e->nonClientArea);
2226 bool doubleClick =
false;
2227 auto persistentEPD = devPriv->
pointById(0);
2233 const auto pressPos = persistentEPD->eventPoint.globalPressPosition();
2234 if (
qAbs(globalPoint.
x() - pressPos.x()) > doubleClickDistance ||
2235 qAbs(globalPoint.
y() - pressPos.y()) > doubleClickDistance)
2241 doubleClick =
e->timestamp - persistentEPD->eventPoint.pressTimestamp()
2247 if (
e->nullWindow()) {
2261 localPoint =
window->mapFromGlobal(globalPoint);
2269 if (!
e->synthetic()) {
2274 QMouseEvent ev(
type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint,
2279 ev.QInputEvent::setTimestamp(
e->timestamp);
2280 cursor->pointerEvent(ev);
2289 QMutableEventPoint::setGlobalLastPosition(persistentEPD->eventPoint, lastGlobalPosition);
2290 persistentEPD =
nullptr;
2293 if (
window->d_func()->blockedByModalWindow && !
qApp->d_func()->popupActive()) {
2303 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2306 && !
e->nonClientArea
2338 if (!
e->window.isNull() ||
e->nullWindow()) {
2340 QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
2343 QGuiApplication::sendSpontaneousEvent(
window, &dblClickEvent);
2356#if QT_CONFIG(wheelevent)
2358 QPointF globalPoint =
e->globalPos;
2361 if (
e->nullWindow()) {
2364 localPoint =
window->mapFromGlobal(globalPoint);
2373 if (
window->d_func()->blockedByModalWindow) {
2379 QWheelEvent ev(localPoint, globalPoint,
e->pixelDelta,
e->angleDelta,
2381 ev.setTimestamp(
e->timestamp);
2382 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2383 e->eventAccepted = ev.isAccepted();
2401#if defined(Q_OS_ANDROID)
2402 static bool backKeyPressAccepted =
false;
2403 static bool menuKeyPressAccepted =
false;
2406#if !defined(Q_OS_MACOS)
2411 e->nativeScanCode,
e->nativeVirtualKey,
e->nativeModifiers,
e->unicode,
e->repeat,
e->repeatCount)) {
2412#if defined(Q_OS_ANDROID)
2422 e->nativeScanCode,
e->nativeVirtualKey,
e->nativeModifiers,
2423 e->unicode,
e->repeat,
e->repeatCount);
2429 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2453 if (
e->enter.data()->d_func()->blockedByModalWindow) {
2471 QMutableEventPoint::setVelocity(epd->eventPoint, {});
2473 QCoreApplication::sendSpontaneousEvent(
e->enter.data(), &
event);
2480 if (
e->leave.data()->d_func()->blockedByModalWindow) {
2488 QCoreApplication::sendSpontaneousEvent(
e->leave.data(), &
event);
2494 QWindow *newFocus =
e->activated.data();
2496 if (previous == newFocus)
2501 if (platformWindow->isAlertState())
2502 platformWindow->setAlertState(
false);
2508 QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);
2521 QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
2544 if (previousFocusObject !=
qApp->focusObject() ||
2550 (previous && previousFocusObject ==
nullptr &&
qApp->focusObject() ==
nullptr)) {
2555 emit qApp->focusWindowChanged(newFocus);
2557 emit previous->activeChanged();
2559 emit newFocus->activeChanged();
2570 if (newEffectiveState != originalEffectiveState)
2571 emit window->windowStateChanged(newEffectiveState);
2576 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2586 if (
QWindow *topLevelWindow =
window->d_func()->topLevelWindow(QWindow::ExcludeTransients)) {
2588 topLevelWindow->d_func()->setTopLevelScreen(
screen,
false );
2590 topLevelWindow->setScreen(
nullptr);
2635 for (
auto *
window : windows)
2636 QGuiApplication::sendSpontaneousEvent(
window, &themeChangeEvent);
2668 if (
e->window.isNull())
2675 const QRect lastReportedGeometry =
window->d_func()->geometry;
2676 const QRect requestedGeometry =
e->requestedGeometry;
2677 const QRect actualGeometry =
e->newGeometry;
2687 const bool isResize = actualGeometry.
size() != lastReportedGeometry.
size()
2688 || requestedGeometry.
size() != actualGeometry.
size();
2689 const bool isMove = actualGeometry.
topLeft() != lastReportedGeometry.
topLeft()
2692 window->d_func()->geometry = actualGeometry;
2694 if (isResize ||
window->d_func()->resizeEventPending) {
2696 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2698 window->d_func()->resizeEventPending =
false;
2700 if (actualGeometry.
width() != lastReportedGeometry.
width())
2702 if (actualGeometry.
height() != lastReportedGeometry.
height())
2709 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2711 if (actualGeometry.
x() != lastReportedGeometry.
x())
2713 if (actualGeometry.
y() != lastReportedGeometry.
y())
2720 if (
e->window.isNull())
2722 if (
e->window.data()->d_func()->blockedByModalWindow && !
e->window.data()->d_func()->inClose) {
2725 e->eventAccepted =
false;
2730 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &
event);
2732 e->eventAccepted =
event.isAccepted();
2737 if (
e->url.isEmpty())
2741 QGuiApplication::sendSpontaneousEvent(
qApp, &
event);
2748 if (pointData.
deviceId == deviceId)
2758#if QT_CONFIG(tabletevent)
2763 if (
e->buttons != pointData.
state)
2769 bool localValid =
true;
2774 if (
e->nullWindow()) {
2782 if (
e->nullWindow()) {
2787 pointData.
target =
nullptr;
2793 QPointF delta =
e->global -
e->global.toPoint();
2794 local =
window->mapFromGlobal(
e->global.toPoint()) + delta;
2798 Qt::MouseButtons stateChange =
e->buttons ^ pointData.
state;
2801 if (check & stateChange) {
2807 QTabletEvent tabletEvent(
type,
device, local,
e->global,
2808 e->pressure,
e->xTilt,
e->yTilt,
2809 e->tangentialPressure,
e->rotation,
e->z,
2811 tabletEvent.setAccepted(
false);
2812 tabletEvent.setTimestamp(
e->timestamp);
2813 QGuiApplication::sendSpontaneousEvent(
window, &tabletEvent);
2814 pointData.
state =
e->buttons;
2815 if (!tabletEvent.isAccepted()
2824 default: Q_UNREACHABLE();
2830 qCDebug(lcPtrDispatch) <<
"synthesizing mouse from tablet event" << mouseType
2831 <<
e->local <<
button <<
e->buttons <<
e->modifiers;
2841#if QT_CONFIG(tabletevent)
2846 ev.setTimestamp(
e->timestamp);
2847 QGuiApplication::sendSpontaneousEvent(
qGuiApp, &ev);
2855#if QT_CONFIG(tabletevent)
2860 ev.setTimestamp(
e->timestamp);
2861 QGuiApplication::sendSpontaneousEvent(
qGuiApp, &ev);
2867#ifndef QT_NO_GESTURES
2870 if (
e->window.isNull())
2875 e->delta,
e->sequenceId);
2876 ev.setTimestamp(
e->timestamp);
2877 QGuiApplication::sendSpontaneousEvent(
e->window, &ev);
2886 if (
e->window->d_func()->blockedByModalWindow) {
2892 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &ev);
2895#ifndef QT_NO_CONTEXTMENU
2900 if (!
e->window ||
e->mouseTriggered ||
e->window->d_func()->blockedByModalWindow)
2904 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &ev);
2921 touchEvent.setTimestamp(
e->timestamp);
2926 windowsNeedingCancel.
insert(
w);
2930 winItEnd = windowsNeedingCancel.
constEnd(); winIt != winItEnd; ++winIt) {
2931 QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent);
2936 if (!synthIt->window)
2971 for (
auto &tempPt :
e->points) {
2973 auto epd = devPriv->
pointById(tempPt.id());
2976 switch (tempPt.state()) {
2984 QMutableEventPoint::setWindow(ep,
window);
2989 qCDebug(lcPtrDispatch) <<
"delivering touch release to same window"
2996 qCDebug(lcPtrDispatch) <<
"delivering touch update to same window"
3003 qCWarning(lcPtrDispatch) <<
"skipping" << &tempPt <<
": no target window";
3011 QMutableEventPoint::setScenePosition(ep, tempPt.globalPosition());
3014 QMutableEventPoint::setPosition(ep,
window->mapFromGlobal(tempPt.globalPosition()));
3022 if (ev.target() ==
window.data()) {
3043 switch (touchEvent.touchPointStates()) {
3055 if (
window->d_func()->blockedByModalWindow && !
qApp->d_func()->popupActive()) {
3063 touchEvent.setTimestamp(
e->timestamp);
3064 QGuiApplication::sendSpontaneousEvent(
window, &touchEvent);
3072 QGuiApplication::sendSpontaneousEvent(
window, &touchEvent);
3082 m_fakeMouseSourcePointId = touchEvent.
point(0).
id();
3083 qCDebug(lcPtrDispatch) <<
"synthesizing mouse events from touchpoint" << m_fakeMouseSourcePointId;
3085 if (m_fakeMouseSourcePointId >= 0) {
3086 const auto *touchPoint = touchEvent.pointById(m_fakeMouseSourcePointId);
3088 switch (touchPoint->state()) {
3097 Q_ASSERT(m_fakeMouseSourcePointId == touchPoint->id());
3098 m_fakeMouseSourcePointId = -1;
3105 touchPoint->position(), touchPoint->globalPosition(),
window));
3111 window->mapFromGlobal(touchPoint->globalPosition().toPoint()),
3112 touchPoint->globalPosition(),
3148 s->d_func()->orientation =
e->orientation;
3150 emit s->orientationChanged(
s->orientation());
3171 s->d_func()->geometry =
e->geometry;
3172 s->d_func()->availableGeometry =
e->availableGeometry;
3174 s->d_func()->updatePrimaryOrientation();
3194 s->d_func()->logicalDpi =
QDpi(
e->dpiX,
e->dpiY);
3195 s->d_func()->updateGeometry();
3199 if (
window->screen() ==
e->screen)
3220 s->d_func()->refreshRate =
rate;
3221 emit s->refreshRateChanged(
s->refreshRate());
3235 if (!
p->receivedExpose) {
3236 if (
p->resizeEventPending) {
3240 QGuiApplication::sendSpontaneousEvent(
window, &
e);
3242 p->resizeEventPending =
false;
3251 p->receivedExpose =
true;
3257 const bool wasExposed =
p->exposed;
3258 p->exposed =
e->isExposed &&
window->screen();
3261 if (wasExposed &&
p->exposed && shouldSynthesizePaintEvents) {
3263 QCoreApplication::sendSpontaneousEvent(
window, &paintEvent);
3273 QCoreApplication::sendSpontaneousEvent(
window, &exposeEvent);
3281 if (!wasExposed &&
p->exposed && shouldSynthesizePaintEvents) {
3283 QCoreApplication::sendSpontaneousEvent(
window, &paintEvent);
3290 "The platform sent paint events without claiming support for it in QPlatformIntegration::capabilities()");
3296 QCoreApplication::sendSpontaneousEvent(
e->window, &paintEvent);
3303#if QT_CONFIG(draganddrop)
3310static void updateMouseAndModifierButtonState(Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers)
3317 const QPoint &
p, Qt::DropActions supportedActions,
3318 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers)
3320 updateMouseAndModifierButtonState(buttons,
modifiers);
3324 if (!platformDrag || (
w &&
w->d_func()->blockedByModalWindow)) {
3336 QDragMoveEvent me(
p, supportedActions, dropData, buttons,
modifiers);
3345 QDragEnterEvent
e(
p, supportedActions, dropData, buttons,
modifiers);
3348 lastAcceptedDropAction =
e.dropAction();
3353 && (supportedActions & lastAcceptedDropAction)) {
3354 me.setDropAction(lastAcceptedDropAction);
3358 lastAcceptedDropAction = me.isAccepted() ?
3364 const QPoint &
p, Qt::DropActions supportedActions,
3365 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers)
3367 updateMouseAndModifierButtonState(buttons,
modifiers);
3371 QDropEvent de(
p, supportedActions, dropData, buttons,
modifiers);
3381#ifndef QT_NO_CLIPBOARD
3389 qWarning(
"QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard");
3429 qGuiApp->d_func()->handlePaletteChanged();
3435void QGuiApplicationPrivate::clearPalette()
3452 qGuiApp->d_func()->handlePaletteChanged();
3490#if QT_DEPRECATED_SINCE(6, 0)
3533 qWarning(
"QGuiApplication::font(): no QGuiApplication instance and no application font set.");
3559#if QT_DEPRECATED_SINCE(6, 0)
3675 emit q_func()->lastWindowClosed();
3698 if (!windowPrivate->participatesInLastWindowClosed())
3701 if (windowPrivate->treatAsVisible())
3806 QCoreApplication::sendSpontaneousEvent(
qApp, &appActivate);
3810 QCoreApplication::sendSpontaneousEvent(
qApp, &appDeactivate);
3817 QCoreApplication::sendSpontaneousEvent(
qApp, &
event);
3925#ifndef QT_NO_SESSIONMANAGER
3929 return d->is_session_restored;
3935 return d->session_manager->sessionId();
3941 return d->session_manager->sessionKey();
3947 return d->is_saving_session;
4047 return qGuiApp->d_func()->cursor_list.isEmpty() ?
nullptr : &
qGuiApp->d_func()->cursor_list.first();
4061 if (
qGuiApp->d_func()->cursor_list.isEmpty())
4063 qGuiApp->d_func()->cursor_list.removeFirst();
4081 cursor->changeCursor(
nullptr,
w);
4086 for (
int i = 0;
i < l.
size(); ++
i) {
4105 cursor->clearOverrideCursor();
4111 for (
int i = 0;
i < l.
size(); ++
i) {
4173 if (
qGuiApp->d_func()->cursor_list.isEmpty())
4175 qGuiApp->d_func()->cursor_list.removeFirst();
4176 if (
qGuiApp->d_func()->cursor_list.size() > 0) {
4246 if (!
qGuiApp->d_func()->inputMethod)
4248 return qGuiApp->d_func()->inputMethod;
4275 return QPoint(std::numeric_limits<int>::max(), std::numeric_limits<int>::max());
4279#if QT_CONFIG(draganddrop)
4280void QGuiApplicationPrivate::notifyDragStarted(
const QDrag *drag)
4290 if (!m_a8ColorProfile)
4292 return m_a8ColorProfile.get();
4300 if (!m_a32ColorProfile)
4302 return m_a32ColorProfile.get();
4315 emit q->focusObjectChanged(
object);
4331 if (!m_inputDeviceManager)
4334 return m_inputDeviceManager;
4358#if defined(Q_OS_WIN)
4364#if defined(Q_OS_UNIX)
4373#include "moc_qguiapplication.cpp"
IOBluetoothDevice * device
virtual void startingUp()
static void clearIconTypeCache()
Type loadRelaxed() const noexcept
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool startsWith(QByteArrayView bv) const
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
void clear()
Clears the contents of the byte array and makes it null.
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
QChar toUpper() const noexcept
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
The QClipboard class provides access to the window system clipboard.
The QCloseEvent class contains parameters that describe a close event.
static std::shared_ptr< QColorTrcLut > fromGamma(qreal gamma)
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
QCoreApplicationPrivate::Type application_type
static bool is_app_closing
static bool is_app_running
static QAbstractEventDispatcher * eventDispatcher
virtual bool canQuitAutomatically()
void * resolveInterface(const char *name, int revision) const
\macro Q_DECLARE_TR_FUNCTIONS(context)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
bool event(QEvent *) override
\reimp
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
static void quit()
\threadsafe
virtual bool notify(QObject *, QEvent *)
Sends event to receiver: {receiver}->event(event).
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes some pending events for the calling thread according to the specified flags.
void applicationNameChanged()
friend class QGuiApplication
static void setAttribute(Qt::ApplicationAttribute attribute, bool on=true)
Sets the attribute attribute if on is true; otherwise clears the attribute.
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
static int exec()
Enters the main event loop and waits until exit() is called.
static bool startingUp()
Returns true if an application object has not been created yet; otherwise returns false.
QString applicationName
the name of this application
The QCursor class provides a mouse cursor with an arbitrary shape.
static bool isAbsolutePath(const QString &path)
Returns true if path is absolute; returns false if it is relative.
static bool setCurrent(const QString &path)
Sets the application's current working directory to path.
static QString toNativeSeparators(const QString &pathName)
static QString currentPath()
Returns the absolute path of the application's current directory.
void start() noexcept
Starts this timer.
The QEventPoint class provides information about a point in a QPointerEvent.
int id
the ID number of this event point.
void setAccepted(bool accepted=true)
virtual void setAccepted(bool accepted)
Type
This enum type defines the valid event types in Qt.
@ ApplicationPaletteChange
@ NonClientAreaMouseButtonDblClick
@ ApplicationLayoutDirectionChange
@ ApplicationWindowIconChange
@ NonClientAreaMouseButtonPress
Type type() const
Returns the event type.
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
bool exists() const
Returns true if the file exists; otherwise returns false.
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
const mapped_container_type & values() const noexcept
The QFocusEvent class contains event parameters for widget focus events.
static bool removeAllApplicationFonts()
\reentrant \inmodule QtGui
static QObject * create(const QString &, const QString &)
static Qt::ApplicationState applicationState
void maybeLastWindowClosed()
static void processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e)
static void setApplicationState(Qt::ApplicationState state, bool forcePropagate=false)
static bool obey_desktop_settings
static QPointer< QWindow > currentDragWindow
QHash< QWindow *, SynthesizedMouseData > synthesizedMousePoints
static void processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e)
QSessionManager * session_manager
bool canQuitAutomatically() override
static void updateBlockedStatus(QWindow *window)
void createPlatformIntegration()
QEvent::Type lastTouchType
static QWindow * currentMousePressWindow
static void processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
static void showModalWindow(QWindow *window)
static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result)
QInputMethod * inputMethod
static void updatePalette()
static Qt::KeyboardModifiers modifier_buttons
bool lastWindowClosed() const
static void processPaintEvent(QWindowSystemInterfacePrivate::PaintEvent *e)
static void processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
static void hideModalWindow(QWindow *window)
static QPlatformIntegration * platformIntegration()
static QWindowList window_list
static void processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e)
static QList< TabletPointData > tabletDevicePoints
virtual QPalette basePalette() const
static void processScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e)
void _q_updateFocusObject(QObject *object)
static QStyleHints * styleHints
static TabletPointData & tabletDevicePoint(qint64 deviceId)
static void processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)
static void processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e)
static void processScreenRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e)
static QList< QObject * > generic_plugin_list
static void processScreenGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e)
static void processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e)
static void processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e)
static QList< QScreen * > screen_list
static QPalette * app_pal
static Qt::ColorScheme colorScheme()
QGuiApplicationPrivate::colorScheme.
static void processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
static void resetCachedDevicePixelRatio()
static QClipboard * qt_clipboard
static void processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *e)
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy
static QString * desktopFileName
static Qt::MouseButtons mouse_buttons
virtual bool windowNeverBlocked(QWindow *window) const
static void processGestureEvent(QWindowSystemInterfacePrivate::GestureEvent *e)
static QWindow * currentMouseWindow
~QGuiApplicationPrivate()
static QString styleOverride
static QInputDeviceManager * inputDeviceManager()
QPixmap getPixmapCursor(Qt::CursorShape cshape)
static void processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)
bool isWindowBlocked(QWindow *window, QWindow **blockingWindow=nullptr) const
const QColorTrcLut * colorProfileForA8Text()
static QPlatformTheme * platform_theme
static void processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
static void processScreenLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e)
static void processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e)
static void captureGlobalModifierState(QEvent *e)
virtual void handlePaletteChanged(const char *className=nullptr)
static void processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *e)
QGuiApplicationPrivate(int &argc, char **argv)
static void processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)
static QString * platform_name
static void processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e)
static QWindow * focus_window
void createEventDispatcher() override
Called from QCoreApplication::init()
virtual void handleThemeChanged()
static Qt::MouseButton mousePressButton
static bool sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event)
static void processWindowDevicePixelRatioChangedEvent(QWindowSystemInterfacePrivate::WindowDevicePixelRatioChangedEvent *e)
static QString * displayName
static struct QGuiApplicationPrivate::QLastCursorPosition lastCursorPosition
static void processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
QWindowList modalWindowList
virtual void notifyActiveWindowChange(QWindow *previous)
static bool setPalette(const QPalette &palette)
virtual void notifyLayoutDirectionChange()
static QPlatformIntegration * platform_integration
static bool quitOnLastWindowClosed
void eventDispatcherReady() override
const QColorTrcLut * colorProfileForA32Text()
virtual Qt::WindowModality defaultModality() const
static void processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e)
static void processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce)
static void applyWindowGeometrySpecificationTo(QWindow *window)
static void processSafeAreaMarginsChangedEvent(QWindowSystemInterfacePrivate::SafeAreaMarginsChangedEvent *e)
static QPlatformTheme * platformTheme()
virtual void notifyWindowIconChanged()
Q_SLOT void setBadgeNumber(qint64 number)
Sets the application's badge to number.
static QFunctionPointer platformFunction(const QByteArray &function)
static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy)
static Qt::ApplicationState applicationState()
static void setQuitOnLastWindowClosed(bool quit)
static QPlatformNativeInterface * platformNativeInterface()
bool notify(QObject *, QEvent *) override
\reimp
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
static QWindow * modalWindow()
Returns the most recently shown modal window.
static QWindow * topLevelAt(const QPoint &pos)
Returns the top level window at the given position pos, if any.
static void setDesktopFileName(const QString &name)
static void setFont(const QFont &)
Changes the default application font to font.
bool isSavingSession() const
static QWindowList allWindows()
Returns a list of all the windows in the application.
static QClipboard * clipboard()
Returns the object for interacting with the clipboard.
QScreen * primaryScreen
the primary (or default) screen of the application.
bool isSessionRestored() const
Returns true if the application has been restored from an earlier \l{Session Management}{session}; ot...
static QPalette palette()
Returns the current application palette.
static QObject * focusObject()
Returns the QObject in currently active window that will be final receiver of events tied to focus,...
static void setPalette(const QPalette &pal)
Changes the application palette to pal.
static QCursor * overrideCursor()
Returns the active application override cursor.
bool quitOnLastWindowClosed
whether the application implicitly quits when the last window is closed.
static QFont font()
Returns the default application font.
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override
static QStyleHints * styleHints()
Returns the application's style hints.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
static void changeOverrideCursor(const QCursor &)
Changes the currently active application override cursor to cursor.
static void setApplicationDisplayName(const QString &name)
qreal devicePixelRatio() const
Returns the highest screen device pixel ratio found on the system.
void applicationDisplayNameChanged()
QString sessionKey() const
Returns the session key in the current \l{Session Management}{session}.
static void setLayoutDirection(Qt::LayoutDirection direction)
static QInputMethod * inputMethod()
returns the input method.
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
static Qt::KeyboardModifiers queryKeyboardModifiers()
Queries and returns the state of the modifier keys on the keyboard.
static void setDesktopSettingsAware(bool on)
Sets whether Qt should use the system's standard colors, fonts, etc., to on.
QString applicationDisplayName
the user-visible name of this application
static void setOverrideCursor(const QCursor &)
Sets the application override cursor to cursor.
bool event(QEvent *) override
\reimp
static void restoreOverrideCursor()
Undoes the last setOverrideCursor().
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.; otherwise returns false.
~QGuiApplication()
Destructs the application.
QString platformName
The name of the underlying platform plugin.
QString sessionId() const
Returns the current \l{Session Management}{session's} identifier.
QString desktopFileName
the base name of the desktop entry for this application
Qt::LayoutDirection layoutDirection
the default layout direction for this application
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
static int exec()
Enters the main event loop and waits until exit() is called, and then returns the value that was set ...
static QList< QScreen * > screens()
Returns a list of all the screens associated with the windowing system the application is connected t...
QIcon windowIcon
the default window icon
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy()
static void setWindowIcon(const QIcon &icon)
static void updateHighDpiScaling()
static void initHighDpiScaling()
static QIconLoader * instance()
static void clearIconCache()
The QIcon class provides scalable icons in different modes and states.
static QIcon fromTheme(const QString &name)
The QKeyEvent class describes a key event.
static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION
static QStringList platformPluginArguments(const QString &platformName)
Returns additional arguments to the platform plugin matching platformName which can be specified as a...
\inmodule QtCore \reentrant
bool load()
Loads the library and returns true if the library was loaded successfully; otherwise returns false.
QFunctionPointer resolve(const char *symbol)
Returns the address of the exported symbol symbol.
QString errorString() const
qsizetype size() const noexcept
void removeFirst() noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
void prepend(rvalue_ref t)
void append(parameter_type t)
The QMoveEvent class contains event parameters for move events.
static Q_GUI_EXPORT void update(const QEventPoint &from, QEventPoint &to)
static Q_GUI_EXPORT void setTimestamp(QEventPoint &p, ulong t)
static QWindow * window(const QEventPoint &p)
void setDoubleClick(bool d=true)
static QMutableSinglePointEvent * from(QSinglePointEvent *e)
void setTarget(QObject *target)
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
QAtomicPointer< QThreadData > threadData
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void setFormat(const QSurfaceFormat &format)
Sets the format the OpenGL context should be compatible with.
The QPaintEvent class contains event parameters for paint events.
The QPalette class contains color groups for each widget state.
void setResolveMask(ResolveMask mask)
ResolveMask resolveMask() const
static void clear()
Removes all pixmaps from the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
static void setInputMethodAccepted(bool accepted)
The QPlatformInputContext class abstracts the input method dependent data and composing state.
virtual void setFocusObject(QObject *object)
This virtual method gets called to notify updated focus to object.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
void setTimestamp(quint64 timestamp) override
void clearPassiveGrabbers(const QEventPoint &point)
Removes all passive grabbers from the given point.
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
EventPointMap activePoints
QWindow * firstActiveWindow() const
EventPointData * queryPointById(int id) const
EventPointData * pointById(int id) const
static QPointingDevicePrivate * get(QPointingDevice *q)
void removePointById(int id)
qint64 numericId
the numeric unique ID of the token represented by a touchpoint
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
QPointingDeviceUniqueId uniqueId
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QResizeEvent class contains event parameters for resize events.
The QScreen class is used to query screen properties. \inmodule QtGui.
qreal devicePixelRatio
the screen's ratio between physical pixels and device-independent pixels
QList< QScreen * > virtualSiblings() const
Get the screen's virtual siblings.
QPlatformScreen * handle() const
Get the platform screen handle.
The QSessionManager class provides access to the session manager.
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
iterator insert(const T &value)
Qt::MouseButton button() const
Returns the button that caused the event.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
QString section(QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const
This function returns a section of the string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QStyleHintsPrivate * get(QStyleHints *q)
void setColorScheme(Qt::ColorScheme colorScheme)
The QStyleHints class contains platform specific hints and settings. \inmodule QtGui.
int mouseDoubleClickInterval
the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks.
QEventPoint & point(int touchId)
The QTouchEvent class contains parameters that describe a touch event.
bool contains(const AT &t) const
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
static QWindowPrivate * get(QWindow *window)
virtual void processSafeAreaMarginsChanged()
Qt::WindowStates windowState
static Qt::WindowState effectiveState(Qt::WindowStates)
void updateDevicePixelRatio()
Qt::ApplicationState newState
QEventLoop::ProcessEventsFlags flags
QPointer< QWindow > window
static bool platformSynthesizesMouse
QPointer< QWindow > window
QPointer< QWindow > window
QPointer< QWindow > window
QPointer< QScreen > screen
Qt::WindowStates newState
Qt::WindowStates oldState
QPointer< QWindow > window
@ ApplicationStateChanged
@ ScreenLogicalDotsPerInch
@ WindowDevicePixelRatioChanged
static QList< QEventPoint > fromNativeTouchPoints(const QList< QWindowSystemInterface::TouchPoint > &points, const QWindow *window, QEvent::Type *type=nullptr)
static QElapsedTimer eventTime
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static void deferredFlushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
static bool handleCloseEvent(QWindow *window)
static bool handleShortcutEvent(QWindow *window, ulong timestamp, int k, Qt::KeyboardModifiers mods, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text=QString(), bool autorep=false, ushort count=1)
Qt::WindowFlags flags
the window flags of the window
virtual QObject * focusObject() const
Returns the QObject that will be the final receiver of events tied focus, such as key events.
Qt::WindowModality modality
the modality of the window
EGLImageKHR int int EGLuint64KHR * modifiers
QList< QVariant > arguments
T toNativePixels(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
Combined button and popup list for selecting options.
constexpr bool isAsciiDigit(char32_t c) noexcept
@ MouseEventSynthesizedByQt
@ MouseEventNotSynthesized
@ AA_SynthesizeMouseForUnhandledTabletEvents
@ AA_DontShowShortcutsInContextMenus
@ AA_SynthesizeMouseForUnhandledTouchEvents
@ AA_SynthesizeTouchForUnhandledMouseEvents
HighDpiScaleFactorRoundingPolicy
@ ActiveWindowFocusReason
#define QT_WARNING_DISABLE_DEPRECATED
void Q_CORE_EXPORT qt_call_post_routines()
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
bool qIsInf(qfloat16 f) noexcept
static bool needsWindowBlockedEvent(const QWindow *w)
static void applyCursor(QWindow *w, QCursor c)
Q_CORE_EXPORT void qt_call_post_routines()
static void init_plugins(const QList< QByteArray > &pluginList)
static Q_CONSTINIT unsigned applicationResourceFlags
static void initFontUnlocked()
static void clearFontUnlocked()
static void clearOverrideCursor(const QList< QScreen * > &screens)
void qRegisterGuiVariant()
static void applyWindowCursor(const QList< QWindow * > &l)
static Q_CONSTINIT bool force_reverse
static QWindowGeometrySpecification windowGeometrySpecification
static void unsetCursor(QWindow *w)
static bool qt_detectRTLLanguage()
static bool checkNeedPortalSupport()
static Q_CONSTINIT Qt::LayoutDirection effective_layout_direction
#define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER
static Q_CONSTINIT int mouseDoubleClickDistance
static void init_platform(const QString &pluginNamesWithArguments, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)
static Q_CONSTINIT Qt::LayoutDirection layout_direction
static Q_CONSTINIT int touchDoubleTapDistance
static void initThemeHints()
static void applyOverrideCursor(const QList< QScreen * > &screens, const QCursor &c)
static Q_CONSTINIT QBasicMutex applicationFontMutex
static int nextGeometryToken(const QByteArray &a, int &pos, char *op)
Q_CONSTINIT Q_GUI_EXPORT bool qt_is_tty_app
#define CHECK_QAPP_INSTANCE(...)
@ ApplicationFontExplicitlySet
static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked)
static Q_CONSTINIT qreal fontSmoothingGamma
void qt_cleanupFontDatabase()
void qRegisterGuiGetInterpolator()
QPair< qreal, qreal > QDpi
#define Q_LOGGING_CATEGORY(name,...)
#define qCInfo(category,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType)
constexpr T qAbs(const T &t)
static QString themeName()
QOpenGLContext * qt_gl_global_share_context()
void qt_gl_set_global_share_context(QOpenGLContext *context)
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define Q_TRACE_PARAM_REPLACE(in, out)
#define Q_TRACE_SCOPE(x,...)
#define Q_TRACE_INSTRUMENT(provider)
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
bool testFlag(MaskType mask, FlagType flag)
static const wchar_t * themeNames[QWindowsVistaStylePrivate::NThemes]
const char className[16]
[1]
myObject disconnect()
[26]
void processTouchEvent()
[toString-overload]
Q_GUI_EXPORT QPoint toPoint() const noexcept
constexpr void reset() noexcept
void applyTo(QWindow *window) const
static QWindowGeometrySpecification fromArgument(const QByteArray &a)