43 #include "private/qguiapplication_p.h"
44 #include "private/qabstractfileiconprovider_p.h"
45 #include <qpa/qplatformintegrationfactory_p.h>
46 #include "private/qevent_p.h"
47 #include "private/qeventpoint_p.h"
50 #include <qpa/qplatformfontdatabase.h>
51 #include <qpa/qplatformwindow.h>
52 #include <qpa/qplatformnativeinterface.h>
53 #include <qpa/qplatformtheme.h>
54 #include <qpa/qplatformintegration.h>
56 #include <QtCore/QAbstractEventDispatcher>
57 #include <QtCore/QStandardPaths>
58 #include <QtCore/QVariant>
59 #include <QtCore/private/qcoreapplication_p.h>
60 #include <QtCore/private/qabstracteventdispatcher_p.h>
61 #include <QtCore/qmutex.h>
62 #include <QtCore/private/qthread_p.h>
63 #include <QtCore/private/qlocking_p.h>
64 #include <QtCore/private/qflatmap_p.h>
65 #include <QtCore/qdir.h>
66 #include <QtCore/qlibraryinfo.h>
67 #include <QtCore/private/qnumeric_p.h>
69 #ifndef QT_NO_ACCESSIBILITY
75 #include <private/qcolortrclut_p.h>
76 #include <private/qscreen_p.h>
78 #include <QtGui/qgenericpluginfactory.h>
79 #include <QtGui/qstylehints.h>
80 #include <QtGui/qinputmethod.h>
81 #include <QtGui/qpixmapcache.h>
82 #include <qpa/qplatforminputcontext.h>
83 #include <qpa/qplatforminputcontext_p.h>
85 #include <qpa/qwindowsysteminterface.h>
86 #include <qpa/qwindowsysteminterface_p.h>
87 #include "private/qwindow_p.h"
88 #include "private/qcursor_p.h"
89 #include "private/qopenglcontext_p.h"
90 #include "private/qinputdevicemanager_p.h"
91 #include "private/qinputmethod_p.h"
92 #include "private/qpointingdevice_p.h"
94 #include <qpa/qplatformthemefactory_p.h>
96 #if QT_CONFIG(draganddrop)
97 #include <qpa/qplatformdrag.h>
98 #include <private/qdnd_p.h>
102 #include <qpa/qplatformcursor.h>
105 #include <QtGui/QPixmap>
107 #ifndef QT_NO_CLIPBOARD
108 #include <QtGui/QClipboard>
111 #if QT_CONFIG(library)
112 #include <QtCore/QLibrary>
115 #if defined(Q_OS_MAC)
116 # include "private/qcore_mac_p.h"
117 #elif defined(Q_OS_WIN)
118 # include <QtCore/qt_windows.h>
119 # include <QtCore/QLibraryInfo>
123 #include <emscripten.h>
126 #include <qtgui_tracepoints_p.h>
134 #define CHECK_QAPP_INSTANCE(...) \
135 if (Q_LIKELY(QCoreApplication::instance())) { \
137 qWarning("Must construct a QGuiApplication first."); \
138 return __VA_ARGS__; \
172 static unsigned applicationResourceFlags = 0;
184 static int mouseDoubleClickDistance = 0;
185 static int touchDoubleTapDistance = 0;
191 static bool force_reverse =
false;
194 int QGuiApplicationPrivate::m_fakeMouseSourcePointId = -1;
196 #ifndef QT_NO_CLIPBOARD
212 qreal QGuiApplicationPrivate::m_maxDevicePixelRatio = 0.0;
214 static qreal fontSmoothingGamma = 1.7;
219 #if QT_CONFIG(animation)
223 static bool qt_detectRTLLanguage()
225 return force_reverse ^
227 "Translate this string to the string 'LTR' in left-to-right"
228 " languages or to 'RTL' in right-to-left languages (such as Hebrew"
229 " and Arabic) to get proper widget layout.") ==
QLatin1String(
"RTL"));
232 static void initFontUnlocked()
244 static inline void clearFontUnlocked()
250 static void initThemeHints()
256 static bool checkNeedPortalSupport()
266 #define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER { Qt::TopLeftCorner, -1, -1, -1, -1 }
283 static inline int nextGeometryToken(
const QByteArray &
a,
int &
pos,
char *
op)
286 const int size =
a.size();
291 if (*
op ==
'+' || *
op ==
'-' || *
op ==
'x')
293 else if (isdigit(*
op))
298 const int numberPos =
pos;
302 const int result =
a.mid(numberPos,
pos - numberPos).toInt(&
ok);
310 for (
int i = 0;
i < 4; ++
i) {
321 if (
result.xOffset >= 0) {
340 const QSize windowMinimumSize =
window->minimumSize();
341 const QSize windowMaximumSize =
window->maximumSize();
349 const QRect availableGeometry =
window->screen()->virtualGeometry();
361 window->setFramePosition(topLeft);
680 d->eventDispatcher->closingDown();
681 d->eventDispatcher =
nullptr;
683 #ifndef QT_NO_CLIPBOARD
688 #ifndef QT_NO_SESSIONMANAGER
689 delete d->session_manager;
690 d->session_manager =
nullptr;
693 QGuiApplicationPrivate::clearPalette();
697 d->cursor_list.clear();
706 delete QGuiApplicationPrivate::m_inputDeviceManager;
707 QGuiApplicationPrivate::m_inputDeviceManager =
nullptr;
722 lastTouchType(
QEvent::TouchEnd),
723 ownGlobalShareContext(
false)
727 #ifndef QT_NO_SESSIONMANAGER
813 if (QGuiApplicationPrivate::self->modalWindowList.isEmpty())
818 static void updateBlockedStatusRecursion(
QWindow *
window,
bool shouldBeBlocked)
821 if (
p->blockedByModalWindow != shouldBeBlocked) {
822 p->blockedByModalWindow = shouldBeBlocked;
826 if (
c->isWindowType())
827 updateBlockedStatusRecursion(
static_cast<QWindow *
>(
c), shouldBeBlocked);
834 bool shouldBeBlocked =
false;
838 updateBlockedStatusRecursion(
window, shouldBeBlocked);
844 static inline bool needsWindowBlockedEvent(
const QWindow *
w)
851 self->modalWindowList.prepend(modal);
856 if (shouldBeBlocked) {
858 self->modalWindowList.removeFirst();
862 self->modalWindowList.prepend(modal);
867 if (needsWindowBlockedEvent(
window) && !
window->d_func()->blockedByModalWindow)
876 self->modalWindowList.removeAll(
window);
879 if (needsWindowBlockedEvent(
window) &&
window->d_func()->blockedByModalWindow)
896 *blockingWindow =
nullptr;
905 if (
window == modalWindow || modalWindow->isAncestorOf(
window, QWindow::IncludeTransients)) {
906 *blockingWindow =
nullptr;
911 switch (windowModality) {
914 if (modalWindow !=
window) {
915 *blockingWindow = modalWindow;
932 p =
m->transientParent();
937 p =
w->transientParent();
943 Q_ASSERT_X(
false,
"QGuiApplication",
"internal error, a modal widget cannot be modeless");
947 *blockingWindow =
nullptr;
1014 for (
int i = 0;
i <
list.size(); ++
i) {
1016 if (!
window->isTopLevel())
1027 if (
window->handle() &&
window->handle()->isEmbedded())
1072 if (sibling->geometry().contains(point))
1075 visitedScreens.
append(sibling);
1127 if (!
qFuzzyIsNull(QGuiApplicationPrivate::m_maxDevicePixelRatio))
1128 return QGuiApplicationPrivate::m_maxDevicePixelRatio;
1130 QGuiApplicationPrivate::m_maxDevicePixelRatio = 1.0;
1132 QGuiApplicationPrivate::m_maxDevicePixelRatio = qMax(QGuiApplicationPrivate::m_maxDevicePixelRatio,
screen->
devicePixelRatio());
1134 return QGuiApplicationPrivate::m_maxDevicePixelRatio;
1139 m_maxDevicePixelRatio = 0.0;
1149 return windowScreen->handle()->topLevelAt(devicePosition);
1197 static void init_platform(
const QString &pluginNamesWithArguments,
const QString &platformPluginPath,
const QString &platformThemeName,
int &argc,
char **argv)
1199 qCDebug(lcQpaPluginLoading) <<
"init_platform called with"
1200 <<
"pluginNamesWithArguments" << pluginNamesWithArguments
1201 <<
"platformPluginPath" << platformPluginPath
1202 <<
"platformThemeName" << platformThemeName;
1207 for (
const auto &pluginArgument : plugins) {
1216 argumentsKey[0] = argumentsKey.
at(0).
toUpper();
1219 qCDebug(lcQpaPluginLoading) <<
"Attempting to load Qt platform plugin" <<
name <<
"with arguments" <<
arguments;
1224 if (availablePlugins.contains(
name)) {
1225 qCInfo(lcQpaPluginLoading).nospace().noquote()
1226 <<
"Could not load the Qt platform plugin \"" <<
name <<
"\" in \""
1229 qCWarning(lcQpaPluginLoading).nospace().noquote()
1230 <<
"Could not find the Qt platform plugin \"" <<
name <<
"\" in \""
1234 qCDebug(lcQpaPluginLoading) <<
"Successfully loaded Qt platform plugin" <<
name;
1242 QString fatalMessage =
QStringLiteral(
"This application failed to start because no Qt platform plugin could be initialized. "
1243 "Reinstalling the application may fix this problem.\n");
1245 if (!availablePlugins.isEmpty())
1248 #if defined(Q_OS_WIN)
1254 qFatal(
"%s", qPrintable(fatalMessage));
1263 if (!platformThemeName.
isEmpty()) {
1264 qCDebug(lcQpaTheme) <<
"Adding" << platformThemeName <<
"from environment to list of theme names";
1265 themeNames.append(platformThemeName);
1269 if (checkNeedPortalSupport()) {
1270 qCDebug(lcQpaTheme) <<
"Adding xdgdesktopportal to list of theme names";
1276 qCDebug(lcQpaTheme) <<
"Adding platform integration's theme names to list of theme names:" << platformIntegrationThemeNames;
1277 themeNames += platformIntegrationThemeNames;
1279 for (
const QString &themeName : qAsConst(themeNames)) {
1280 qCDebug(lcQpaTheme) <<
"Attempting to create platform theme" << themeName <<
"via QPlatformThemeFactory::create";
1283 qCDebug(lcQpaTheme) <<
"Successfully created platform theme" << themeName;
1291 for (
const QString &themeName : qAsConst(themeNames)) {
1292 qCDebug(lcQpaTheme) <<
"Attempting to create platform theme" << themeName <<
"via createPlatformTheme";
1295 qCDebug(lcQpaTheme) <<
"Successfully created platform theme" << themeName;
1304 qCDebug(lcQpaTheme) <<
"Failed to create platform theme; using \"null\" platform theme";
1308 #ifndef QT_NO_PROPERTIES
1311 if (!platformArguments.isEmpty()) {
1319 nativeInterface->setProperty(
name.constData(),
value);
1333 for (
int i = 0;
i < pluginList.
count(); ++
i) {
1335 int colonPos = pluginSpec.
indexOf(
':');
1349 #if QT_CONFIG(commandlineparser)
1352 QCoreApplicationPrivate::addQtOptions(options);
1354 #if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
1355 const QByteArray sessionType = qgetenv(
"XDG_SESSION_TYPE");
1356 const bool x11 = sessionType ==
"x11";
1359 const bool x11 =
false;
1377 QGuiApplication::tr(
"Sets the application's layout direction to Qt::RightToLeft (debugging helper).")));
1412 #ifdef QT_QPA_DEFAULT_PLATFORM_NAME
1413 platformName = QT_QPA_DEFAULT_PLATFORM_NAME;
1415 #if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
1419 const bool hasWaylandDisplay = qEnvironmentVariableIsSet(
"WAYLAND_DISPLAY");
1420 const bool isWaylandSessionType = qgetenv(
"XDG_SESSION_TYPE") ==
"wayland";
1423 const bool defaultIsXcb = platformPluginBase ==
"xcb";
1424 const QByteArray xcbPlatformName = defaultIsXcb ? platformName :
"xcb";
1425 if (qEnvironmentVariableIsSet(
"DISPLAY")) {
1426 preferredPlatformOrder << xcbPlatformName;
1428 platformName.
clear();
1431 const bool defaultIsWayland = !defaultIsXcb && platformPluginBase.
startsWith(
"wayland");
1432 const QByteArray waylandPlatformName = defaultIsWayland ? platformName :
"wayland";
1433 if (hasWaylandDisplay || isWaylandSessionType) {
1434 preferredPlatformOrder.
prepend(waylandPlatformName);
1436 if (defaultIsWayland)
1437 platformName.
clear();
1441 preferredPlatformOrder.
append(platformName);
1443 platformName = preferredPlatformOrder.join(
';');
1446 bool platformExplicitlySelected =
false;
1447 QByteArray platformNameEnv = qgetenv(
"QT_QPA_PLATFORM");
1448 if (!platformNameEnv.
isEmpty()) {
1449 platformName = platformNameEnv;
1450 platformExplicitlySelected =
true;
1459 int j =
argc ? 1 : 0;
1463 if (*
argv[
i] !=
'-') {
1467 const bool xcbIsDefault = platformName.
startsWith(
"xcb");
1471 if (
strcmp(
arg,
"-platformpluginpath") == 0) {
1474 }
else if (
strcmp(
arg,
"-platform") == 0) {
1476 platformExplicitlySelected =
true;
1477 platformName =
argv[
i];
1479 }
else if (
strcmp(
arg,
"-platformtheme") == 0) {
1482 }
else if (
strcmp(
arg,
"-qwindowgeometry") == 0 || (xcbIsDefault &&
strcmp(
arg,
"-geometry") == 0)) {
1485 }
else if (
strcmp(
arg,
"-qwindowtitle") == 0 || (xcbIsDefault &&
strcmp(
arg,
"-title") == 0)) {
1488 }
else if (
strcmp(
arg,
"-qwindowicon") == 0 || (xcbIsDefault &&
strcmp(
arg,
"-icon") == 0)) {
1502 Q_UNUSED(platformExplicitlySelected);
1506 if (!
icon.isEmpty())
1541 #if defined(Q_OS_MACOS)
1542 QMacAutoReleasePool
pool;
1549 bool loadTestability =
false;
1552 #ifndef QT_NO_SESSIONMANAGER
1555 # if defined(Q_OS_WIN)
1556 wchar_t guidstr[40];
1558 CoCreateGuid(&guid);
1559 StringFromGUID2(guid, guidstr, 40);
1561 CoCreateGuid(&guid);
1562 StringFromGUID2(guid, guidstr, 40);
1567 int j =
argc ? 1 : 0;
1571 if (*
argv[
i] !=
'-') {
1580 pluginList <<
argv[
i];
1581 }
else if (
strcmp(
arg,
"-reverse") == 0) {
1582 force_reverse =
true;
1590 kCFURLPOSIXPathStyle));
1595 #ifndef QT_NO_SESSIONMANAGER
1602 session_key = session_id.
mid(
p +1);
1603 session_id = session_id.
left(
p);
1608 }
else if (
strcmp(
arg,
"-testability") == 0) {
1609 loadTestability =
true;
1610 }
else if (
strncmp(
arg,
"-style=", 7) == 0) {
1628 QByteArray envPlugins = qgetenv(
"QT_QPA_GENERIC_PLUGINS");
1630 pluginList += envPlugins.
split(
',');
1639 #ifndef QT_NO_CURSOR
1646 #if QT_CONFIG(animation)
1652 #ifndef QT_NO_OPENGL
1658 ownGlobalShareContext =
true;
1665 init_plugins(pluginList);
1669 #ifndef QT_NO_SESSIONMANAGER
1674 #if QT_CONFIG(library)
1675 if (qEnvironmentVariableIntValue(
"QT_LOAD_TESTABILITY") > 0)
1676 loadTestability =
true;
1678 if (loadTestability) {
1683 typedef void (*TasInitialize)(
void);
1684 TasInitialize initFunction = (TasInitialize)testLib.
resolve(
"qt_testability_init");
1686 qCritical(
"Library qttestability resolve failed!");
1715 clearFontUnlocked();
1719 #ifndef QT_NO_CURSOR
1735 #ifndef QT_NO_OPENGL
1736 if (ownGlobalShareContext) {
1756 #ifndef QT_NO_CURSOR
1758 void setOverrideCursor(
const QCursor &);
1759 void changeOverrideCursor(
const QCursor &);
1760 void restoreOverrideCursor();
1769 #ifndef QT_NO_CLIPBOARD
1812 return pi->queryKeyboardModifiers();
1841 return pi ?
pi->nativeInterface() :
nullptr;
1852 qWarning(
"QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function");
1856 return pi->nativeInterface() ?
pi->nativeInterface()->platformFunction(
function) :
nullptr;
1884 #ifndef QT_NO_ACCESSIBILITY
1892 if (
e->spontaneous()) {
1900 switch (
e->type()) {
1922 #if QT_CONFIG(wheelevent)
1928 #if QT_CONFIG(tabletevent)
1948 if (
object->isWindowType()) {
1981 if (!topLevelWindow->handle())
1983 if (!topLevelWindow->close()) {
2006 if (!platformWindow)
2009 if (
event->spontaneous())
2022 Q_TRACE_SCOPE(QGuiApplicationPrivate_processWindowSystemEvent,
e->type);
2111 #ifndef QT_NO_GESTURES
2125 #ifndef QT_NO_CONTEXTMENU
2135 qWarning() <<
"Unknown user input event type:" <<
e->type;
2161 bool mouseMove =
false;
2164 QPointF globalPoint =
e->globalPos;
2167 qWarning(
"QGuiApplicationPrivate::processMouseEvent: Got NaN in mouse position");
2171 type =
e->buttonType;
2179 if (!mouseMove && positionChanged) {
2183 e->source,
e->nonClientArea);
2200 bool doubleClick =
false;
2201 auto persistentEPD = devPriv->
pointById(0);
2206 mouseDoubleClickDistance : touchDoubleTapDistance);
2207 const auto pressPos = persistentEPD->eventPoint.globalPressPosition();
2208 if (
qAbs(globalPoint.
x() - pressPos.x()) > doubleClickDistance ||
2209 qAbs(globalPoint.
y() - pressPos.y()) > doubleClickDistance)
2215 doubleClick =
e->timestamp - persistentEPD->eventPoint.pressTimestamp()
2221 if (
e->nullWindow()) {
2235 localPoint =
window->mapFromGlobal(globalPoint);
2242 #ifndef QT_NO_CURSOR
2243 if (!
e->synthetic()) {
2248 QMouseEvent ev(
type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint,
2253 ev.QInputEvent::setTimestamp(
e->timestamp);
2254 cursor->pointerEvent(ev);
2263 QMutableEventPoint::setGlobalLastPosition(persistentEPD->eventPoint, lastGlobalPosition);
2264 persistentEPD =
nullptr;
2267 if (
window->d_func()->blockedByModalWindow && !
qApp->d_func()->popupActive()) {
2277 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2280 && !
e->nonClientArea
2291 point.
state = QEventPoint::State::Pressed;
2293 point.
state = QEventPoint::State::Released;
2295 point.
state = QEventPoint::State::Updated;
2312 if (!
e->window.isNull() ||
e->nullWindow()) {
2314 QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
2317 QGuiApplication::sendSpontaneousEvent(
window, &dblClickEvent);
2330 #if QT_CONFIG(wheelevent)
2332 QPointF globalPoint =
e->globalPos;
2335 if (
e->nullWindow()) {
2338 localPoint =
window->mapFromGlobal(globalPoint);
2347 if (
window->d_func()->blockedByModalWindow) {
2353 QWheelEvent ev(localPoint, globalPoint,
e->pixelDelta,
e->angleDelta,
2355 ev.setTimestamp(
e->timestamp);
2356 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2374 #if defined(Q_OS_ANDROID)
2375 static bool backKeyPressAccepted =
false;
2376 static bool menuKeyPressAccepted =
false;
2379 #if !defined(Q_OS_MACOS)
2384 e->nativeScanCode,
e->nativeVirtualKey,
e->nativeModifiers,
e->unicode,
e->repeat,
e->repeatCount)) {
2385 #if defined(Q_OS_ANDROID)
2395 e->nativeScanCode,
e->nativeVirtualKey,
e->nativeModifiers,
2396 e->unicode,
e->repeat,
e->repeatCount);
2402 QGuiApplication::sendSpontaneousEvent(
window, &ev);
2426 if (
e->enter.data()->d_func()->blockedByModalWindow) {
2444 QMutableEventPoint::setVelocity(epd->eventPoint, {});
2446 QCoreApplication::sendSpontaneousEvent(
e->enter.data(), &
event);
2453 if (
e->leave.data()->d_func()->blockedByModalWindow) {
2461 QCoreApplication::sendSpontaneousEvent(
e->leave.data(), &
event);
2467 QWindow *newFocus =
e->activated.data();
2469 if (previous == newFocus)
2474 if (platformWindow->isAlertState())
2475 platformWindow->setAlertState(
false);
2477 QObject *previousFocusObject = previous ? previous->focusObject() :
nullptr;
2481 QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);
2494 QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
2515 self->notifyActiveWindowChange(previous);
2517 if (previousFocusObject !=
qApp->focusObject() ||
2523 (previous && previousFocusObject ==
nullptr &&
qApp->focusObject() ==
nullptr)) {
2524 self->_q_updateFocusObject(
qApp->focusObject());
2528 emit qApp->focusWindowChanged(newFocus);
2530 emit previous->activeChanged();
2532 emit newFocus->activeChanged();
2540 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2549 if (
QWindow *topLevelWindow =
window->d_func()->topLevelWindow(QWindow::ExcludeTransients)) {
2551 topLevelWindow->d_func()->setTopLevelScreen(
screen,
false );
2553 topLevelWindow->setScreen(
nullptr);
2582 self->notifyThemeChanged();
2585 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2591 if (
e->window.isNull())
2598 const QRect lastReportedGeometry =
window->d_func()->geometry;
2599 const QRect requestedGeometry =
e->requestedGeometry;
2600 const QRect actualGeometry =
e->newGeometry;
2610 const bool isResize = actualGeometry.
size() != lastReportedGeometry.
size()
2611 || requestedGeometry.
size() != actualGeometry.
size();
2612 const bool isMove = actualGeometry.
topLeft() != lastReportedGeometry.
topLeft()
2615 window->d_func()->geometry = actualGeometry;
2617 if (isResize ||
window->d_func()->resizeEventPending) {
2619 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2621 window->d_func()->resizeEventPending =
false;
2623 if (actualGeometry.
width() != lastReportedGeometry.
width())
2625 if (actualGeometry.
height() != lastReportedGeometry.
height())
2632 QGuiApplication::sendSpontaneousEvent(
window, &
e);
2634 if (actualGeometry.
x() != lastReportedGeometry.
x())
2636 if (actualGeometry.
y() != lastReportedGeometry.
y())
2643 if (
e->window.isNull())
2645 if (
e->window.data()->d_func()->blockedByModalWindow) {
2651 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &
event);
2653 e->eventAccepted =
event.isAccepted();
2658 if (
e->url.isEmpty())
2662 QGuiApplication::sendSpontaneousEvent(
qApp, &
event);
2669 if (pointData.
deviceId == deviceId)
2679 #if QT_CONFIG(tabletevent)
2684 if (
e->buttons != pointData.
state)
2690 bool localValid =
true;
2695 if (
e->nullWindow()) {
2703 if (
e->nullWindow()) {
2708 pointData.
target =
nullptr;
2714 QPointF delta =
e->global -
e->global.toPoint();
2715 local =
window->mapFromGlobal(
e->global.toPoint()) + delta;
2719 Qt::MouseButtons stateChange =
e->buttons ^ pointData.
state;
2722 if (check & stateChange) {
2729 e->pressure,
e->xTilt,
e->yTilt,
2730 e->tangentialPressure,
e->rotation,
e->z,
2732 tabletEvent.setAccepted(
false);
2733 tabletEvent.setTimestamp(
e->timestamp);
2734 QGuiApplication::sendSpontaneousEvent(
window, &tabletEvent);
2735 pointData.
state =
e->buttons;
2736 if (!tabletEvent.isAccepted()
2760 #if QT_CONFIG(tabletevent)
2765 ev.setTimestamp(
e->timestamp);
2766 QGuiApplication::sendSpontaneousEvent(
qGuiApp, &ev);
2774 #if QT_CONFIG(tabletevent)
2779 ev.setTimestamp(
e->timestamp);
2780 QGuiApplication::sendSpontaneousEvent(
qGuiApp, &ev);
2786 #ifndef QT_NO_GESTURES
2789 if (
e->window.isNull())
2794 e->delta,
e->sequenceId);
2795 ev.setTimestamp(
e->timestamp);
2796 QGuiApplication::sendSpontaneousEvent(
e->window, &ev);
2805 if (
e->window->d_func()->blockedByModalWindow) {
2811 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &ev);
2814 #ifndef QT_NO_CONTEXTMENU
2819 if (!
e->window ||
e->mouseTriggered ||
e->window->d_func()->blockedByModalWindow)
2823 QGuiApplication::sendSpontaneousEvent(
e->window.data(), &ev);
2845 windowsNeedingCancel.
insert(
w);
2849 winItEnd = windowsNeedingCancel.
constEnd(); winIt != winItEnd; ++winIt) {
2850 QGuiApplication::sendSpontaneousEvent(*winIt, &
touchEvent);
2855 if (!synthIt->window)
2871 self->synthesizedMousePoints.clear();
2873 self->lastTouchType =
e->touchType;
2881 self->lastTouchType =
e->touchType;
2890 for (
auto &tempPt :
e->points) {
2892 auto epd = devPriv->
pointById(tempPt.id());
2894 epd->eventPoint.setAccepted(
false);
2895 switch (tempPt.state()) {
2896 case QEventPoint::State::Pressed:
2903 QMutableEventPoint::setWindow(ep,
window);
2906 case QEventPoint::State::Released:
2908 qCWarning(lcPtrDispatch) <<
"delivering touch release to same window"
2915 qCWarning(lcPtrDispatch) <<
"delivering touch update to same window"
2922 qCWarning(lcPtrDispatch) <<
"skipping" << &tempPt <<
": no target window";
2930 QMutableEventPoint::setScenePosition(ep, tempPt.globalPosition());
2933 QMutableEventPoint::setPosition(ep,
window->mapFromGlobal(tempPt.globalPosition()));
2941 if (ev.target() ==
window.data()) {
2951 touchEvents.append(mte);
2963 case QEventPoint::State::Pressed:
2966 case QEventPoint::State::Released:
2974 if (
window->d_func()->blockedByModalWindow && !
qApp->d_func()->popupActive()) {
3002 qCDebug(lcPtrDispatch) <<
"synthesizing mouse events from touchpoint" << m_fakeMouseSourcePointId;
3004 if (m_fakeMouseSourcePointId >= 0) {
3005 const auto *touchPoint =
touchEvent.pointById(m_fakeMouseSourcePointId);
3007 switch (touchPoint->state()) {
3008 case QEventPoint::State::Pressed:
3012 case QEventPoint::State::Released:
3016 Q_ASSERT(m_fakeMouseSourcePointId == touchPoint->id());
3017 m_fakeMouseSourcePointId = -1;
3022 if (touchPoint->state() != QEventPoint::State::Released) {
3024 touchPoint->position(), touchPoint->globalPosition(),
window));
3030 window->mapFromGlobal(touchPoint->globalPosition().toPoint()),
3031 touchPoint->globalPosition(),
3044 self->synthesizedMousePoints.clear();
3052 if (touchPoint.state() == QEventPoint::State::Released)
3067 s->d_func()->orientation =
e->orientation;
3069 emit s->orientationChanged(
s->orientation());
3086 bool geometryChanged =
e->geometry !=
s->d_func()->geometry;
3087 s->d_func()->geometry =
e->geometry;
3089 bool availableGeometryChanged =
e->availableGeometry !=
s->d_func()->availableGeometry;
3090 s->d_func()->availableGeometry =
e->availableGeometry;
3093 if (geometryChanged)
3094 s->d_func()->updatePrimaryOrientation();
3096 s->d_func()->emitGeometryChangeSignals(geometryChanged, availableGeometryChanged);
3098 if (geometryChanged) {
3099 emit s->physicalSizeChanged(
s->physicalSize());
3100 emit s->logicalDotsPerInchChanged(
s->logicalDotsPerInch());
3102 if (
s->primaryOrientation() != primaryOrientation)
3103 emit s->primaryOrientationChanged(
s->primaryOrientation());
3121 s->d_func()->logicalDpi =
QDpi(
e->dpiX,
e->dpiY);
3123 emit s->logicalDotsPerInchChanged(
s->logicalDotsPerInch());
3124 s->d_func()->updateGeometriesWithSignals();
3144 s->d_func()->refreshRate =
rate;
3145 emit s->refreshRateChanged(
s->refreshRate());
3159 if (!
p->receivedExpose) {
3160 if (
p->resizeEventPending) {
3164 QGuiApplication::sendSpontaneousEvent(
window, &
e);
3166 p->resizeEventPending =
false;
3175 p->receivedExpose =
true;
3181 const bool wasExposed =
p->exposed;
3182 p->exposed =
e->isExposed &&
window->screen();
3185 if (wasExposed &&
p->exposed && shouldSynthesizePaintEvents) {
3187 QCoreApplication::sendSpontaneousEvent(
window, &paintEvent);
3197 QCoreApplication::sendSpontaneousEvent(
window, &exposeEvent);
3205 if (!wasExposed &&
p->exposed && shouldSynthesizePaintEvents) {
3207 QCoreApplication::sendSpontaneousEvent(
window, &paintEvent);
3214 "The platform sent paint events without claiming support for it in QPlatformIntegration::capabilities()");
3220 QCoreApplication::sendSpontaneousEvent(
e->window, &paintEvent);
3227 #if QT_CONFIG(draganddrop)
3234 static void updateMouseAndModifierButtonState(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
3241 const QPoint &
p, Qt::DropActions supportedActions,
3242 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
3244 updateMouseAndModifierButtonState(buttons, modifiers);
3248 if (!platformDrag || (
w &&
w->d_func()->blockedByModalWindow)) {
3260 QDragMoveEvent me(
p, supportedActions, dropData, buttons, modifiers);
3269 QDragEnterEvent
e(
p, supportedActions, dropData, buttons, modifiers);
3272 lastAcceptedDropAction =
e.dropAction();
3277 && (supportedActions & lastAcceptedDropAction)) {
3278 me.setDropAction(lastAcceptedDropAction);
3282 lastAcceptedDropAction = me.isAccepted() ?
3288 const QPoint &
p, Qt::DropActions supportedActions,
3289 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
3291 updateMouseAndModifierButtonState(buttons, modifiers);
3295 QDropEvent de(
p, supportedActions, dropData, buttons, modifiers);
3305 #ifndef QT_NO_CLIPBOARD
3313 qWarning(
"QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard");
3353 qGuiApp->d_func()->handlePaletteChanged();
3359 void QGuiApplicationPrivate::clearPalette()
3376 qGuiApp->d_func()->handlePaletteChanged();
3453 qWarning(
"QGuiApplication::font(): no QGuiApplication instance and no application font set.");
3509 for (
int i = 0;
i <
list.size(); ++
i) {
3554 for (
int i = 0;
i <
list.size(); ++
i)
3591 emit q_func()->lastWindowClosed();
3614 if (!windowPrivate->participatesInLastWindowClosed())
3617 if (windowPrivate->treatAsVisible())
3722 QCoreApplication::sendSpontaneousEvent(
qApp, &appActivate);
3726 QCoreApplication::sendSpontaneousEvent(
qApp, &appDeactivate);
3733 QCoreApplication::sendSpontaneousEvent(
qApp, &
event);
3841 #ifndef QT_NO_SESSIONMANAGER
3845 return d->is_session_restored;
3851 return d->session_manager->sessionId();
3857 return d->session_manager->sessionKey();
3863 return d->is_saving_session;
3926 if (
direction == effective_layout_direction)
3946 return effective_layout_direction;
3959 #ifndef QT_NO_CURSOR
3963 return qGuiApp->d_func()->cursor_list.isEmpty() ?
nullptr : &
qGuiApp->d_func()->cursor_list.first();
3977 if (
qGuiApp->d_func()->cursor_list.isEmpty())
3979 qGuiApp->d_func()->cursor_list.removeFirst();
3985 #ifndef QT_NO_CURSOR
3993 static inline void unsetCursor(
QWindow *
w)
3997 cursor->changeCursor(
nullptr,
w);
4002 for (
int i = 0;
i <
l.size(); ++
i) {
4021 cursor->clearOverrideCursor();
4027 for (
int i = 0;
i <
l.size(); ++
i) {
4031 applyCursor(
w,
w->cursor());
4089 if (
qGuiApp->d_func()->cursor_list.isEmpty())
4091 qGuiApp->d_func()->cursor_list.removeFirst();
4092 if (
qGuiApp->d_func()->cursor_list.size() > 0) {
4162 if (!
qGuiApp->d_func()->inputMethod)
4164 return qGuiApp->d_func()->inputMethod;
4184 QPoint QGuiApplicationPrivate::QLastCursorPosition::toPoint()
const noexcept
4188 return QPoint(std::numeric_limits<int>::max(), std::numeric_limits<int>::max());
4189 return thePoint.toPoint();
4200 clearFontUnlocked();
4206 #if QT_CONFIG(draganddrop)
4207 void QGuiApplicationPrivate::notifyDragStarted(
const QDrag *drag)
4217 if (!m_a8ColorProfile)
4219 return m_a8ColorProfile.get();
4227 if (!m_a32ColorProfile)
4229 return m_a32ColorProfile.get();
4242 emit q->focusObjectChanged(
object);
4258 if (!m_inputDeviceManager)
4261 return m_inputDeviceManager;
4285 #if defined(Q_OS_WIN)
4295 #include "moc_qguiapplication.cpp"
small capitals from c petite p scientific i
[1]
virtual void startingUp()
static void clearIconTypeCache()
static void setRootObject(QObject *object)
The QByteArray class provides an array of bytes.
const char * constData() const noexcept
QList< QByteArray > split(char sep) const
qsizetype indexOf(char c, qsizetype from=0) const
bool startsWith(QByteArrayView bv) const
bool isEmpty() const noexcept
QByteArray mid(qsizetype index, qsizetype len=-1) const
QChar toUpper() const noexcept
The QClipboard class provides access to the window system clipboard. \inmodule QtGui.
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.
The QCoreApplication class provides an event loop for Qt applications without UI.
void * resolveInterface(const char *name, int revision) const
static QCoreApplication * instance()
static bool sendEvent(QObject *receiver, QEvent *event)
bool event(QEvent *) override
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *)
virtual bool notify(QObject *, QEvent *)
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
void applicationNameChanged()
friend class QGuiApplication
static void setAttribute(Qt::ApplicationAttribute attribute, bool on=true)
[95]
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
QString applicationName
the name of this application
static bool is_app_closing
QCoreApplicationPrivate::Type application_type
static QAbstractEventDispatcher * eventDispatcher
static bool is_app_running
virtual bool canQuitAutomatically()
The QCursor class provides a mouse cursor with an arbitrary shape.
static bool isAbsolutePath(const QString &path)
static bool setCurrent(const QString &path)
static QString toNativeSeparators(const QString &pathName)
static QString currentPath()
The QDrag class provides support for MIME-based drag and drop data transfer.
The QEnterEvent class contains parameters that describe an enter event.
The QEvent class is the base class of all event classes. Event objects contain event parameters.
virtual void setAccepted(bool accepted)
@ ApplicationPaletteChange
@ NonClientAreaMouseButtonDblClick
@ ApplicationLayoutDirectionChange
@ ApplicationWindowIconChange
@ NonClientAreaMouseButtonPress
The QEventPoint class provides information about a point in a QPointerEvent.
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
static QString decodeName(const QByteArray &localFileName)
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
const mapped_container_type & values() const noexcept
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
static bool removeAllApplicationFonts()
The QFont class specifies a query for a font used for drawing text.
The QFontMetrics class provides font metrics information.
static QObject * create(const QString &, const QString &)
The QGuiApplication class manages the GUI application's control flow and main settings.
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
static QWindowList topLevelWindows()
static QWindow * modalWindow()
static QWindow * topLevelAt(const QPoint &pos)
static void setDesktopFileName(const QString &name)
static void setFont(const QFont &)
bool isSavingSession() const
static QWindowList allWindows()
static QClipboard * clipboard()
QScreen * primaryScreen
the primary (or default) screen of the application.
bool isSessionRestored() const
static QPalette palette()
static QObject * focusObject()
static void setPalette(const QPalette &pal)
static QCursor * overrideCursor()
bool quitOnLastWindowClosed
whether the application implicitly quits when the last window is closed.
bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override
static QStyleHints * styleHints()
static QWindow * focusWindow()
static void changeOverrideCursor(const QCursor &)
static void setApplicationDisplayName(const QString &name)
qreal devicePixelRatio() const
void applicationDisplayNameChanged()
QString sessionKey() const
static void setLayoutDirection(Qt::LayoutDirection direction)
static QInputMethod * inputMethod()
static Qt::KeyboardModifiers keyboardModifiers()
static Qt::KeyboardModifiers queryKeyboardModifiers()
static void setDesktopSettingsAware(bool on)
QString applicationDisplayName
the user-visible name of this application
static void setOverrideCursor(const QCursor &)
bool event(QEvent *) override
static void restoreOverrideCursor()
static bool desktopSettingsAware()
QString platformName
The name of the underlying platform plugin.
QString sessionId() const
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)
static QList< QScreen * > screens()
QIcon windowIcon
the default window icon
static Qt::MouseButtons mouseButtons()
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy()
static void setWindowIcon(const QIcon &icon)
static QPlatformIntegration * platformIntegration()
void maybeLastWindowClosed()
static void processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e)
static void setApplicationState(Qt::ApplicationState state, bool forcePropagate=false)
static QPlatformTheme * platform_theme
static QPlatformTheme * platformTheme()
QHash< QWindow *, SynthesizedMouseData > synthesizedMousePoints
static void processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e)
static QWindow * focus_window
QSessionManager * session_manager
bool canQuitAutomatically() override
static void updateBlockedStatus(QWindow *window)
void createPlatformIntegration()
QEvent::Type lastTouchType
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()
bool lastWindowClosed() const
static void processPaintEvent(QWindowSystemInterfacePrivate::PaintEvent *e)
static void processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e)
static void hideModalWindow(QWindow *window)
static QPointer< QWindow > currentDragWindow
static Qt::MouseButtons mouse_buttons
static void processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e)
static Qt::MouseButton mousePressButton
static struct QGuiApplicationPrivate::QLastCursorPosition lastCursorPosition
virtual QPalette basePalette() const
static QWindowList window_list
static void processScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e)
void _q_updateFocusObject(QObject *object)
static Qt::ApplicationState applicationState
static TabletPointData & tabletDevicePoint(qint64 deviceId)
static void processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)
static void processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e)
static void processScreenRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e)
static QString * displayName
static void processScreenGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e)
static void processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e)
static void processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e)
static QPlatformIntegration * platform_integration
static QList< QScreen * > screen_list
static QPalette * app_pal
static bool obey_desktop_settings
static Qt::KeyboardModifiers modifier_buttons
static void processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
static void resetCachedDevicePixelRatio()
static void processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *e)
static void processGestureEvent(QWindowSystemInterfacePrivate::GestureEvent *e)
~QGuiApplicationPrivate()
static QWindow * currentMousePressWindow
static QString * desktopFileName
static QInputDeviceManager * inputDeviceManager()
static QList< QObject * > generic_plugin_list
QPixmap getPixmapCursor(Qt::CursorShape cshape)
static void processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)
virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow=nullptr) const
const QColorTrcLut * colorProfileForA8Text()
static void processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
static void processScreenLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e)
static QStyleHints * styleHints
static void processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e)
static void captureGlobalModifierState(QEvent *e)
static QClipboard * qt_clipboard
virtual void handlePaletteChanged(const char *className=nullptr)
static void processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *e)
static void processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e)
static QString styleOverride
static void processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e)
static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
void createEventDispatcher() override
QGuiApplicationPrivate(int &argc, char **argv, int flags)
static QList< TabletPointData > tabletDevicePoints
static bool sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event)
static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy
static void processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
QWindowList modalWindowList
virtual void notifyActiveWindowChange(QWindow *previous)
static bool setPalette(const QPalette &palette)
virtual void notifyLayoutDirectionChange()
static bool quitOnLastWindowClosed
void eventDispatcherReady() override
const QColorTrcLut * colorProfileForA32Text()
static void processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e)
static void processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce)
virtual void notifyThemeChanged()
static QWindow * currentMouseWindow
static void applyWindowGeometrySpecificationTo(QWindow *window)
static QString * platform_name
static void processSafeAreaMarginsChangedEvent(QWindowSystemInterfacePrivate::SafeAreaMarginsChangedEvent *e)
virtual void notifyWindowIconChanged()
The QHash::const_iterator class provides an STL-style const iterator for QHash.
static void updateHighDpiScaling()
static void initHighDpiScaling()
The QIcon class provides scalable icons in different modes and states.
static QIcon fromTheme(const QString &name)
The QKeyEvent class describes a key event.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QLibrary class loads shared libraries at runtime.
QFunctionPointer resolve(const char *symbol)
QString errorString() const
static bool isDebugBuild()
static QStringList platformPluginArguments(const QString &platformName)
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void prepend(rvalue_ref t)
void append(parameter_type t)
The QMimeData class provides a container for data that records information about its MIME type.
The QMouseEvent class contains parameters that describe a mouse event.
The QMoveEvent class contains event parameters for move events. \inmodule QtGui.
static QWindow * window(const QEventPoint &p)
static Q_GUI_EXPORT void update(const QEventPoint &from, QEventPoint &to)
static Q_GUI_EXPORT void setTimestamp(QEventPoint &p, ulong t)
static QMutableSinglePointEvent * from(QSinglePointEvent *e)
void setDoubleClick(bool d=true)
void setTarget(QObject *target)
The QMutex class provides access serialization between threads.
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
The QOpenGLContext class represents a native OpenGL context, enabling OpenGL rendering on a QSurface.
void setFormat(const QSurfaceFormat &format)
The QPaintEvent class contains event parameters for paint events. \inmodule QtGui.
The QPalette class contains color groups for each widget state.
void setResolveMask(ResolveMask mask)
ResolveMask resolveMask() const
The QPixmap class is an off-screen image representation that can be used as a paint device.
virtual void setFocusObject(QObject *object)
static void setInputMethodAccepted(bool accepted)
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
constexpr QPoint toPoint() const
The QPoint class defines a point in the plane using integer precision.
constexpr void setY(int y) noexcept
constexpr void setX(int x) noexcept
void setTimestamp(quint64 timestamp) override
void clearPassiveGrabbers(const QEventPoint &point)
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
QPointingDeviceUniqueId uniqueId
EventPointMap activePoints
QWindow * firstActiveWindow() const
static QPointingDevicePrivate * get(QPointingDevice *q)
EventPointData * queryPointById(int id) const
EventPointData * pointById(int id) const
void removePointById(int id)
Q_GADGETqint64 numericId
the numeric unique ID of the token represented by a touchpoint
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
constexpr int height() const noexcept
constexpr int bottom() const noexcept
constexpr QPoint topLeft() const noexcept
constexpr int top() const noexcept
constexpr int left() const noexcept
constexpr int x() const noexcept
constexpr QSize size() const noexcept
constexpr int width() const noexcept
constexpr int y() const noexcept
constexpr int right() const noexcept
The QResizeEvent class contains event parameters for resize events. \inmodule QtGui.
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
QPlatformScreen * handle() const
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
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
The QString class provides a Unicode character string.
static QString fromLatin1(QByteArrayView ba)
const ushort * utf16() const
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLocal8Bit(QByteArrayView ba)
QString mid(qsizetype position, qsizetype n=-1) const
QString section(QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const
const QChar at(qsizetype i) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QString left(qsizetype n) const
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QStringList class provides a list of strings.
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
The QVariant class acts like a union for the most common Qt data types.
int toInt(bool *ok=nullptr) const
The QWindow class represents a window in the underlying windowing system.
Qt::WindowFlags flags
the window flags of the window
Qt::WindowModality modality
the modality of the window
virtual void processSafeAreaMarginsChanged()
static QWindowPrivate * get(QWindow *window)
The QWindowStateChangeEvent class provides the window state before a window state change.
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
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::ApplicationState newState
QEventLoop::ProcessEventsFlags flags
QPointer< QWindow > window
static bool platformSynthesizesMouse
QPointer< QWindow > window
QPointer< QWindow > window
QPointer< QScreen > screen
Qt::WindowStates newState
Qt::WindowStates oldState
QPointer< QWindow > window
static QElapsedTimer eventTime
@ ApplicationStateChanged
@ ScreenLogicalDotsPerInch
static QList< QEventPoint > fromNativeTouchPoints(const QList< QWindowSystemInterface::TouchPoint > &points, const QWindow *window, QEvent::Type *type=nullptr)
QList< QVariant > arguments
auto it unsigned count const
T toNativePixels(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
Lock qt_scoped_lock(Mutex &mutex)
Lock qt_unique_lock(Mutex &mutex)
void mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1)
QTouchEventSequence touchEvent(QWindow *window, QPointingDevice *device, bool autoCommit=true)
@ MouseEventSynthesizedByQt
@ MouseEventNotSynthesized
@ AA_SynthesizeMouseForUnhandledTabletEvents
@ AA_DontShowShortcutsInContextMenus
@ AA_SynthesizeMouseForUnhandledTouchEvents
@ AA_SynthesizeTouchForUnhandledMouseEvents
HighDpiScaleFactorRoundingPolicy
@ ActiveWindowFocusReason
int PRIV() strcmp(PCRE2_SPTR str1, PCRE2_SPTR str2)
int PRIV() strncmp(PCRE2_SPTR str1, PCRE2_SPTR str2, size_t len)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
set set set set set set set macro pixldst1 op
#define QT_WARNING_DISABLE_DEPRECATED
EGLOutputLayerEXT EGLint EGLAttrib value
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
bool qIsInf(qfloat16 f) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
Q_CORE_EXPORT void qt_call_post_routines()
Q_GUI_EXPORT bool qt_is_tty_app
void qRegisterGuiVariant()
#define Q_WINDOW_GEOMETRY_SPECIFICATION_INITIALIZER
Q_LOGGING_CATEGORY(lcQpaPluginLoading, "qt.qpa.plugin")
#define CHECK_QAPP_INSTANCE(...)
@ ApplicationFontExplicitlySet
void qt_cleanupFontDatabase()
void qRegisterGuiGetInterpolator()
QPair< qreal, qreal > QDpi
#define qCInfo(category,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define QT_NATIVE_INTERFACE_RETURN_IF(NativeInterface, baseType)
GLenum GLuint GLenum GLsizei const GLchar * message
void qt_gl_set_global_share_context(QOpenGLContext *context)
QOpenGLContext * qt_gl_global_share_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
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
#define Q_ASSERT_X(cond, x, msg)
#define QStringLiteral(str)
#define Q_TRACE_SCOPE(x,...)
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
bool testFlag(MaskType mask, FlagType flag)
const char className[16]
[1]
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void applyTo(QWindow *window) const
static QWindowGeometrySpecification fromArgument(const QByteArray &a)