Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickwindow.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickwindow.h"
5#include "qquickwindow_p.h"
6
7#include "qquickitem.h"
8#include "qquickitem_p.h"
9#include "qquickevents_p_p.h"
11
12#include <QtQuick/private/qsgrenderer_p.h>
13#include <QtQuick/private/qsgplaintexture_p.h>
14#include <QtQuick/private/qquickpointerhandler_p.h>
15#include <private/qsgrenderloop_p.h>
16#include <private/qsgrhisupport_p.h>
17#include <private/qquickrendercontrol_p.h>
18#include <private/qquickanimatorcontroller_p.h>
19#include <private/qquickprofiler_p.h>
20#include <private/qquicktextinterface_p.h>
21
22#include <private/qguiapplication_p.h>
23
24#include <private/qabstractanimation_p.h>
25
26#include <QtGui/qpainter.h>
27#include <QtGui/qevent.h>
28#include <QtGui/qmatrix4x4.h>
29#include <QtGui/private/qevent_p.h>
30#include <QtGui/private/qpointingdevice_p.h>
31#include <QtCore/qvarlengtharray.h>
32#include <QtCore/qabstractanimation.h>
33#include <QtCore/QLibraryInfo>
34#include <QtCore/QRunnable>
35#include <QtQml/qqmlincubator.h>
36#include <QtQml/qqmlinfo.h>
37#include <QtQml/private/qqmlmetatype_p.h>
38
39#include <QtQuick/private/qquickpixmapcache_p.h>
40
41#include <private/qqmldebugserviceinterfaces_p.h>
42#include <private/qqmldebugconnector_p.h>
43#include <private/qsgdefaultrendercontext_p.h>
44#if QT_CONFIG(opengl)
45#include <private/qopengl_p.h>
46#include <QOpenGLContext>
47#endif
48#ifndef QT_NO_DEBUG_STREAM
49#include <private/qdebug_p.h>
50#endif
51
52#include <rhi/qrhi.h>
53
55
60Q_LOGGING_CATEGORY(lcDirty, "qt.quick.dirty")
61Q_LOGGING_CATEGORY(lcTransient, "qt.quick.window.transient")
62
63bool QQuickWindowPrivate::defaultAlphaBuffer = false;
64
65#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
66QQuickWindow::TextRenderType QQuickWindowPrivate::textRenderType = QQuickWindow::QT_QUICK_DEFAULT_TEXT_RENDER_TYPE;
67#else
68QQuickWindow::TextRenderType QQuickWindowPrivate::textRenderType = QQuickWindow::QtTextRendering;
69#endif
70
72{
74
75public:
77 : m_renderLoop(loop), m_timer(0)
78 {
79 // Allow incubation for 1/3 of a frame.
80 m_incubation_time = qMax(1, int(1000 / QGuiApplication::primaryScreen()->refreshRate()) / 3);
81
82 QAnimationDriver *animationDriver = m_renderLoop->animationDriver();
83 if (animationDriver) {
86 }
87 }
88
89protected:
90 void timerEvent(QTimerEvent *) override
91 {
92 killTimer(m_timer);
93 m_timer = 0;
94 incubate();
95 }
96
98 if (m_timer == 0) {
99 // Wait for a while before processing the next batch. Using a
100 // timer to avoid starvation of system events.
101 m_timer = startTimer(m_incubation_time);
102 }
103 }
104
105public slots:
106 void incubate() {
107 if (m_renderLoop && incubatingObjectCount()) {
108 if (m_renderLoop->interleaveIncubation()) {
109 incubateFor(m_incubation_time);
110 } else {
111 incubateFor(m_incubation_time * 2);
114 }
115 }
116 }
117
119
120protected:
122 {
123 if (count && m_renderLoop && !m_renderLoop->interleaveIncubation())
125 }
126
127private:
128 QPointer<QSGRenderLoop> m_renderLoop;
129 int m_incubation_time;
130 int m_timer;
131};
132
133#if QT_CONFIG(accessibility)
138QAccessibleInterface *QQuickWindow::accessibleRoot() const
139{
140 return QAccessible::queryAccessibleInterface(const_cast<QQuickWindow*>(this));
141}
142#endif
143
144
145/*
146Focus behavior
147==============
148
149Prior to being added to a valid window items can set and clear focus with no
150effect. Only once items are added to a window (by way of having a parent set that
151already belongs to a window) do the focus rules apply. Focus goes back to
152having no effect if an item is removed from a window.
153
154When an item is moved into a new focus scope (either being added to a window
155for the first time, or having its parent changed), if the focus scope already has
156a scope focused item that takes precedence over the item being added. Otherwise,
157the focus of the added tree is used. In the case of a tree of items being
158added to a window for the first time, which may have a conflicted focus state (two
159or more items in one scope having focus set), the same rule is applied item by item -
160thus the first item that has focus will get it (assuming the scope doesn't already
161have a scope focused item), and the other items will have their focus cleared.
162*/
163
165{
166 // child items with ItemObservesViewport can treat the window's content item
167 // as the ultimate viewport: avoid populating SG nodes that fall outside
169}
170
173{
174 Q_D(QQuickWindow);
175 if (d->windowManager)
176 d->windowManager->exposureChanged(this);
177}
178
181{
182 Q_D(QQuickWindow);
183 if (d->contentItem)
184 d->contentItem->setSize(ev->size());
185 if (d->windowManager)
186 d->windowManager->resize(this);
187}
188
191{
192 Q_D(QQuickWindow);
193 if (d->windowManager)
194 d->windowManager->show(this);
195}
196
199{
200 Q_D(QQuickWindow);
201 if (auto da = d->deliveryAgentPrivate())
202 da->handleWindowHidden(this);
203 if (d->windowManager)
204 d->windowManager->hide(this);
205}
206
209{
211 qev.setAccepted(e->isAccepted());
212 emit closing(&qev);
213 e->setAccepted(qev.isAccepted());
214}
215
218{
219 Q_D(QQuickWindow);
220 if (d->contentItem)
221 d->contentItem->setFocus(false, ev->reason());
222}
223
226{
227 Q_D(QQuickWindow);
228 if (d->inDestructor)
229 return;
230 if (d->contentItem)
231 d->contentItem->setFocus(true, ev->reason());
232 if (auto da = d->deliveryAgentPrivate())
233 da->updateFocusItemTransform();
234}
235
236#if QT_CONFIG(im)
237static bool transformDirtyOnItemOrAncestor(const QQuickItem *item)
238{
239 while (item) {
240 if (QQuickItemPrivate::get(item)->dirtyAttributes & (
248 return true;
249 }
250 item = item->parentItem();
251 }
252 return false;
253}
254#endif
255
273{
276 {
277 }
278
279 /*
280 * returns true when it detected a likely infinite loop
281 * (suggests it should abort the polish loop)
282 **/
283 bool check(QQuickItem *item, int itemsRemainingBeforeUpdatePolish)
284 {
285 if (itemsToPolish.size() > itemsRemainingBeforeUpdatePolish) {
286 // Detected potential polish loop.
288 if (numPolishLoopsInSequence >= 1000) {
289 // Start to warn about polish loop after 1000 consecutive polish loops
290 if (numPolishLoopsInSequence == 100000) {
291 // We have looped 100,000 times without actually reducing the list of items to
292 // polish, give up for now.
293 // This is not a fix, just a remedy so that the application can be somewhat
294 // responsive.
296 return true;
297 } else if (numPolishLoopsInSequence < 1005) {
298 // Show the 5 next items involved in the polish loop.
299 // (most likely they will be the same 5 items...)
300 QQuickItem *guiltyItem = itemsToPolish.last();
301 qmlWarning(item) << "possible QQuickItem::polish() loop";
302
303 auto typeAndObjectName = [](QQuickItem *item) {
305 QString objName = item->objectName();
306 if (!objName.isNull())
307 return QLatin1String("%1(%2)").arg(typeName, objName);
308 return typeName;
309 };
310
311 qmlWarning(guiltyItem) << typeAndObjectName(guiltyItem)
312 << " called polish() inside updatePolish() of " << typeAndObjectName(item);
313
314 if (numPolishLoopsInSequence == 1004)
315 // Enough warnings. Reset counter in order to speed things up and re-detect
316 // more loops
318 }
319 }
320 } else {
322 }
323 return false;
324 }
325 const QVector<QQuickItem*> &itemsToPolish; // Just a ref to the one in polishItems()
327};
328
330{
331 // An item can trigger polish on another item, or itself for that matter,
332 // during its updatePolish() call. Because of this, we cannot simply
333 // iterate through the set, we must continue pulling items out until it
334 // is empty.
335 // In the case where polish is called from updatePolish() either directly
336 // or indirectly, we use a PolishLoopDetector to determine if a warning should
337 // be printed to the user.
338
339 PolishLoopDetector polishLoopDetector(itemsToPolish);
340 while (!itemsToPolish.isEmpty()) {
341 QQuickItem *item = itemsToPolish.takeLast();
343 itemPrivate->polishScheduled = false;
344 const int itemsRemaining = itemsToPolish.size();
345 itemPrivate->updatePolish();
346 item->updatePolish();
347 if (polishLoopDetector.check(item, itemsRemaining) == true)
348 break;
349 }
350
351#if QT_CONFIG(im)
352 if (QQuickItem *focusItem = q_func()->activeFocusItem()) {
353 // If the current focus item, or any of its anchestors, has changed location
354 // inside the window, we need inform IM about it. This to ensure that overlays
355 // such as selection handles will be updated.
356 const bool isActiveFocusItem = (focusItem == QGuiApplication::focusObject());
357 const bool hasImEnabled = focusItem->inputMethodQuery(Qt::ImEnabled).toBool();
358 if (isActiveFocusItem && hasImEnabled && transformDirtyOnItemOrAncestor(focusItem))
360 }
361#endif
362}
363
372{
373 Q_D(QQuickWindow);
374 if (d->windowManager)
375 d->windowManager->update(this);
376 else if (d->renderControl)
377 QQuickRenderControlPrivate::get(d->renderControl)->update();
378}
379
380static void updatePixelRatioHelper(QQuickItem *item, float pixelRatio)
381{
385 }
386
387 QList <QQuickItem *> items = item->childItems();
388 for (int i = 0; i < items.size(); ++i)
389 updatePixelRatioHelper(items.at(i), pixelRatio);
390}
391
392void QQuickWindow::physicalDpiChanged()
393{
394 Q_D(QQuickWindow);
395 const qreal newPixelRatio = effectiveDevicePixelRatio();
396 if (qFuzzyCompare(newPixelRatio, d->lastReportedItemDevicePixelRatio))
397 return;
398 d->lastReportedItemDevicePixelRatio = newPixelRatio;
399 if (d->contentItem)
400 updatePixelRatioHelper(d->contentItem, newPixelRatio);
401 d->forcePolish();
402}
403
404void QQuickWindow::handleFontDatabaseChanged()
405{
406 Q_D(QQuickWindow);
407 d->pendingFontUpdate = true;
408}
409
411{
413 item->polish();
414 }
415
416 QList <QQuickItem *> items = item->childItems();
417 for (int i=0; i<items.size(); ++i)
419}
420
421void QQuickWindow::handleScreenChanged(QScreen *screen)
422{
423 Q_D(QQuickWindow);
424 Q_UNUSED(screen);
425 d->forcePolish();
426}
427
432{
433 Q_Q(QQuickWindow);
434 if (!q->screen())
435 return;
437}
438
440{
442 item->update();
444
445 QList <QQuickItem *> items = item->childItems();
446 for (int i=0; i<items.size(); ++i)
448}
449
451{
452 if (owns) {
453 if (rhi) {
454 delete renderTarget;
455 delete rpDesc;
456 delete texture;
457 delete renderBuffer;
458 delete depthStencil;
459 }
460
461 delete paintDevice;
462 }
463
464 renderTarget = nullptr;
465 rpDesc = nullptr;
466 texture = nullptr;
467 renderBuffer = nullptr;
468 depthStencil = nullptr;
469 paintDevice = nullptr;
470 owns = false;
471}
472
474{
475 QQuickTextInterface *textItem = qobject_cast<QQuickTextInterface *>(item);
476 if (textItem != nullptr)
477 textItem->invalidate();
478
480 for (QQuickItem *child : children)
482}
483
485{
486 // resolve() can be expensive when importing an existing native texture, so
487 // it is important to only do it when the QQuickRenderTarget* was really changed
489 return;
490
492
494
495 // a default constructed QQuickRenderTarget means no redirection
497 return;
498
500}
501
503{
504 // ownership not transferred
506}
507
509{
510 Q_Q(QQuickWindow);
511
513
514 QRhiCommandBuffer *cb = nullptr;
515 if (rhi) {
518 else
520 }
521 context->prepareSync(q->effectiveDevicePixelRatio(), cb, graphicsConfig);
522
524
525 emit q->beforeSynchronizing();
527
528 if (pendingFontUpdate) {
531 }
532
533 if (!renderer) {
535
536 QSGRootNode *rootNode = new QSGRootNode;
537 rootNode->appendChildNode(QQuickItemPrivate::get(contentItem)->itemNode());
538 const bool useDepth = graphicsConfig.isDepthBufferEnabledFor2D();
541 renderer = context->createRenderer(renderMode);
542 renderer->setRootNode(rootNode);
543 }
544
546
548
549 // Copy the current state of clearing from window into renderer.
551 // Cannot skip clearing the color buffer in Qt 6 anymore.
552 const QSGAbstractRenderer::ClearMode mode = QSGAbstractRenderer::ClearColorBuffer
556
558
559 if (pendingFontUpdate) {
561 pendingFontUpdate = false;
562 }
563
564 emit q->afterSynchronizing();
566}
567
569{
570 QQuickWindow *w = reinterpret_cast<QQuickWindow *>(ud);
571 emit w->beforeRenderPassRecording();
572}
573
575{
576 QQuickWindow *w = reinterpret_cast<QQuickWindow *>(ud);
577 emit w->afterRenderPassRecording();
578}
579
581{
582 Q_Q(QQuickWindow);
583 if (!renderer)
584 return;
585
587
588 QSGRenderTarget sgRenderTarget;
589 if (rhi) {
595 rp = rt->renderPassDescriptor();
596 if (!rp) {
597 qWarning("Custom render target is set but no renderpass descriptor has been provided.");
598 return;
599 }
601 if (!cb) {
602 qWarning("Custom render target is set but no command buffer has been provided.");
603 return;
604 }
605 } else {
606 if (!swapchain) {
607 qWarning("QQuickWindow: No render target (neither swapchain nor custom target was provided)");
608 return;
609 }
613 }
614 sgRenderTarget = QSGRenderTarget(rt, rp, cb);
615 } else {
616 sgRenderTarget = QSGRenderTarget(redirect.rt.paintDevice);
617 }
618
620 sgRenderTarget,
623 q);
624
626 emit q->beforeRendering();
628
629 QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
630 bool flipY = rhi ? !rhi->isYUpInNDC() : false;
632 flipY = !flipY;
633 if (flipY)
635
636 const qreal devicePixelRatio = q->effectiveDevicePixelRatio();
637 QSize pixelSize;
639 pixelSize = redirect.rt.renderTarget->pixelSize();
640 else if (redirect.rt.paintDevice)
642 else if (rhi)
643 pixelSize = swapchain->currentPixelSize();
644 else // software or other backend
645 pixelSize = q->size() * devicePixelRatio;
646
648 renderer->setDeviceRect(QRect(QPoint(0, 0), pixelSize));
649 renderer->setViewportRect(QRect(QPoint(0, 0), pixelSize));
650 renderer->setProjectionMatrixToRect(QRectF(QPointF(0, 0), pixelSize / devicePixelRatio), matrixFlags);
651
653
654 emit q->afterRendering();
656
658
660 // For the overdraw visualizer. This update is not urgent so avoid a
661 // direct update() call, this is only here to keep the overdraw
662 // visualization box rotating even when the scene is static.
664 }
665}
666
668 : contentItem(nullptr)
669 , dirtyItemList(nullptr)
670 , lastReportedItemDevicePixelRatio(0)
673 , windowManager(nullptr)
674 , renderControl(nullptr)
675 , clearColor(Qt::white)
676 , persistentGraphics(true)
677 , persistentSceneGraph(true)
678 , componentCompleted(true)
679 , inDestructor(false)
680 , incubationController(nullptr)
681 , hasActiveSwapchain(false)
682 , hasRenderableSwapchain(false)
683 , swapchainJustBecameRenderable(false)
684 , updatesEnabled(true)
685{
686}
687
689{
690 inDestructor = true;
692 if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
693 service->removeWindow(q_func());
694 deliveryAgent = nullptr;
695}
696
698{
699 Q_Q(QQuickWindow);
700 if (auto root = q->contentItem()) {
701 for (auto &&child: root->childItems()) {
703 }
704 }
705}
706
708{
709 q_ptr = c;
710
711
712 Q_Q(QQuickWindow);
713
715 contentItem->setObjectName(q->objectName());
719 contentItemPrivate->window = q;
720 contentItemPrivate->windowRefCount = 1;
721 contentItemPrivate->flags |= QQuickItem::ItemIsFocusScope;
722 contentItem->setSize(q->size());
724
725 visualizationMode = qgetenv("QSG_VISUALIZE");
726 renderControl = control;
727 if (renderControl)
729
730 if (!renderControl)
732
734
737 q,
738 &QQuickWindow::handleFontDatabaseChanged);
739
740 if (q->screen()) {
741 lastReportedItemDevicePixelRatio = q->effectiveDevicePixelRatio();
742 }
743
744 QSGContext *sg;
745 if (renderControl) {
747 sg = renderControlPriv->sg;
748 context = renderControlPriv->rc;
749 } else {
753 }
754
756 q->setFormat(sg->defaultSurfaceFormat());
757 // When using Vulkan, associating a scenegraph-managed QVulkanInstance with
758 // the window (but only when not using renderControl) is deferred to
759 // QSGRhiSupport::createRhi(). This allows applications to set up their own
760 // QVulkanInstance and set that on the window, if they wish to.
761
763
766 QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::cleanupSceneGraph, Qt::DirectConnection);
767
768 QObject::connect(q, &QQuickWindow::focusObjectChanged, q, &QQuickWindow::activeFocusItemChanged);
769 QObject::connect(q, &QQuickWindow::screenChanged, q, &QQuickWindow::handleScreenChanged);
770 QObject::connect(qApp, &QGuiApplication::applicationStateChanged, q, &QQuickWindow::handleApplicationStateChanged);
771 QObject::connect(q, &QQuickWindow::frameSwapped, q, &QQuickWindow::runJobsAfterSwap, Qt::DirectConnection);
772
773 if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>())
774 service->addWindow(q);
775}
776
777void QQuickWindow::handleApplicationStateChanged(Qt::ApplicationState state)
778{
779 Q_D(QQuickWindow);
780 if (state != Qt::ApplicationActive && d->contentItem) {
781 auto da = d->deliveryAgentPrivate();
782 Q_ASSERT(da);
783 da->handleWindowDeactivate(this);
784 }
785}
786
793{
794 return QQmlListProperty<QObject>(q_func(), nullptr,
801}
802
804{
805 Q_Q(QQuickWindow);
806 q->maybeUpdate();
807}
808
813QQuickItem *QQuickWindow::mouseGrabberItem() const
814{
815 Q_D(const QQuickWindow);
816 auto da = const_cast<QQuickWindowPrivate *>(d)->deliveryAgentPrivate();
817 Q_ASSERT(da);
818 // The normal use case is to call this function while an event is being delivered;
819 // but if the caller knows about the event, it should call QPointerEvent::exclusiveGrabber() instead.
820 if (auto epd = da->mousePointData())
821 return qmlobject_cast<QQuickItem *>(epd->exclusiveGrabber);
822
823 if (Q_LIKELY(d->deliveryAgentPrivate()->eventsInDelivery.isEmpty()))
824 // mousePointData() checked that already: it's one reason epd can be null
825 qCDebug(lcMouse, "mouse grabber ambiguous: no event is currently being delivered");
826 // If no event is being delivered, we can return "the mouse" grabber,
827 // but in general there could be more than one mouse, could be only a touchscreen etc.
828 // That's why this function is obsolete.
830 firstPointExclusiveGrabber());
831}
832
834{
835 Q_Q(QQuickWindow);
836
839 q->maybeUpdate();
840}
841
1050QQuickWindow::QQuickWindow(QWindow *parent)
1052{
1053}
1054
1055
1056
1060QQuickWindow::QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent)
1061 : QWindow(dd, parent)
1062{
1063 Q_D(QQuickWindow);
1064 d->init(this);
1065}
1066
1074QQuickWindow::QQuickWindow(QQuickRenderControl *control)
1076{
1077 Q_D(QQuickWindow);
1078 d->init(this, control);
1079}
1080
1084QQuickWindow::QQuickWindow(QQuickWindowPrivate &dd, QQuickRenderControl *control)
1085 : QWindow(dd, nullptr)
1086{
1087 Q_D(QQuickWindow);
1088 d->init(this, control);
1089}
1090
1095{
1096 Q_D(QQuickWindow);
1097 d->inDestructor = true;
1098 if (d->renderControl) {
1100 } else if (d->windowManager) {
1101 d->windowManager->removeWindow(this);
1102 d->windowManager->windowDestroyed(this);
1103 }
1104
1105 delete d->incubationController; d->incubationController = nullptr;
1106 QQuickRootItem *root = d->contentItem;
1107 d->contentItem = nullptr;
1108 root->setParent(nullptr); // avoid QChildEvent delivery during deletion
1109 delete root;
1110 d->deliveryAgent = nullptr; // avoid forwarding events there during destruction
1111
1112 d->renderJobMutex.lock();
1113 qDeleteAll(d->beforeSynchronizingJobs);
1114 d->beforeSynchronizingJobs.clear();
1115 qDeleteAll(d->afterSynchronizingJobs);
1116 d->afterSynchronizingJobs.clear();
1117 qDeleteAll(d->beforeRenderingJobs);
1118 d->beforeRenderingJobs.clear();
1119 qDeleteAll(d->afterRenderingJobs);
1120 d->afterRenderingJobs.clear();
1121 qDeleteAll(d->afterSwapJobs);
1122 d->afterSwapJobs.clear();
1123 d->renderJobMutex.unlock();
1124
1125 // It is important that the pixmap cache is cleaned up during shutdown.
1126 // Besides playing nice, this also solves a practical problem that
1127 // QQuickTextureFactory implementations in other libraries need
1128 // have their destructors loaded while they the library is still
1129 // loaded into memory.
1131}
1132
1133#if QT_CONFIG(quick_shadereffect)
1135#endif
1136
1164{
1165 Q_D(QQuickWindow);
1166 if (d->windowManager)
1167 d->windowManager->releaseResources(this);
1169#if QT_CONFIG(quick_shadereffect)
1171#endif
1172}
1173
1174
1175
1204void QQuickWindow::setPersistentGraphics(bool persistent)
1205{
1206 Q_D(QQuickWindow);
1207 d->persistentGraphics = persistent;
1208}
1209
1210
1211
1221bool QQuickWindow::isPersistentGraphics() const
1222{
1223 Q_D(const QQuickWindow);
1224 return d->persistentGraphics;
1225}
1226
1227
1228
1251void QQuickWindow::setPersistentSceneGraph(bool persistent)
1252{
1253 Q_D(QQuickWindow);
1254 d->persistentSceneGraph = persistent;
1255}
1256
1257
1258
1267bool QQuickWindow::isPersistentSceneGraph() const
1268{
1269 Q_D(const QQuickWindow);
1270 return d->persistentSceneGraph;
1271}
1272
1291{
1292 Q_D(const QQuickWindow);
1293
1294 return d->contentItem;
1295}
1296
1306{
1307 Q_D(const QQuickWindow);
1308 auto da = d->deliveryAgentPrivate();
1309 Q_ASSERT(da);
1310 return da->activeFocusItem;
1311}
1312
1318{
1319 Q_D(const QQuickWindow);
1320 auto da = d->deliveryAgentPrivate();
1321 Q_ASSERT(da);
1322 if (!d->inDestructor && da->activeFocusItem)
1323 return da->activeFocusItem;
1324 return const_cast<QQuickWindow*>(this);
1325}
1326
1340{
1341 if (pointerEvent->isEndEvent()
1345 if (pointerEvent->isSinglePointEvent()) {
1346 if (static_cast<QSinglePointEvent *>(pointerEvent)->buttons() == Qt::NoButton) {
1347 auto &firstPt = pointerEvent->point(0);
1348 pointerEvent->setExclusiveGrabber(firstPt, nullptr);
1349 pointerEvent->clearPassiveGrabbers(firstPt);
1350 }
1351 } else {
1352 for (auto &point : pointerEvent->points()) {
1353 if (point.state() == QEventPoint::State::Released) {
1354 pointerEvent->setExclusiveGrabber(point, nullptr);
1355 pointerEvent->clearPassiveGrabbers(point);
1356 }
1357 }
1358 }
1359 }
1360}
1361
1364{
1365 Q_D(QQuickWindow);
1366
1367 // bypass QWindow::event dispatching of input events: deliveryAgent takes care of it
1368 QQuickDeliveryAgent *da = d->deliveryAgent;
1369 if (event->isPointerEvent()) {
1370 /*
1371 We can't bypass the virtual functions like mousePressEvent() tabletEvent() etc.,
1372 for the sake of code that subclasses QQuickWindow and overrides them, even though
1373 we no longer need them as entry points for Qt Quick event delivery.
1374 So dispatch to them now, ahead of normal delivery, and stop them from calling
1375 back into this function if they were called from here (avoid recursion).
1376 It could also be that user code expects them to work as entry points, too;
1377 in that case, windowEventDispatch _won't_ be set, so the event comes here and
1378 we'll dispatch it further below.
1379 */
1380 if (d->windowEventDispatch)
1381 return false;
1382 {
1383 const bool wasAccepted = event->isAccepted();
1384 QBoolBlocker windowEventDispatchGuard(d->windowEventDispatch, true);
1385 qCDebug(lcPtr) << "dispatching to window functions in case of override" << event;
1387 if (event->isAccepted() && !wasAccepted)
1388 return true;
1389 }
1390 /*
1391 QQuickWindow does not override touchEvent(). If the application has a subclass
1392 of QQuickWindow which allows the event to remain accepted, it means they want
1393 to stop propagation here, so return early (below). But otherwise we will call
1394 QWindow::touchEvent(), which will ignore(); in that case, we need to continue
1395 with the usual delivery below, so we need to undo the ignore().
1396 */
1397 auto pe = static_cast<QPointerEvent *>(event);
1399 event->accept();
1400 // end of dispatch to user-overridden virtual window functions
1401
1402 /*
1403 When delivering update and release events to existing grabbers,
1404 use the subscene delivery agent, if any. A possible scenario:
1405 1) Two touchpoints pressed on the main window: QQuickWindowPrivate::deliveryAgent delivers to QQuick3DViewport,
1406 which does picking and finds two subscenes ("root" Items mapped onto two different 3D objects) to deliver it to.
1407 2) The QTouchEvent is split up so that each subscene sees points relevant to it.
1408 3) During delivery to either subscene, an item in the subscene grabs.
1409 4) The user moves finger(s) generating a move event: the correct grabber item needs to get the update
1410 via the same subscene delivery agent from which it got the press, so that the coord transform will be done properly.
1411 5) Likewise with the touchpoint releases.
1412 With single-point events (mouse, or only one finger) it's simplified: there can only be one subscene of interest;
1413 for (pt : pe->points()) would only iterate once, so we might as well skip that logic.
1414 */
1415 if (pe->pointCount()) {
1416 const bool synthMouse = QQuickDeliveryAgentPrivate::isSynthMouse(pe);
1418 bool ret = false;
1419 // Split up the multi-point event according to the relevant QQuickDeliveryAgent that should deliver to each existing grabber
1420 // but send ungrabbed points to d->deliveryAgent()
1421 QFlatMap<QQuickDeliveryAgent*, QList<QEventPoint>> deliveryAgentsNeedingPoints;
1422 QEventPoint::States eventStates;
1423
1424 auto insert = [&](QQuickDeliveryAgent *ptda, const QEventPoint &pt) {
1425 if (pt.state() == QEventPoint::Pressed && !synthMouse)
1426 pe->clearPassiveGrabbers(pt);
1427 auto &ptList = deliveryAgentsNeedingPoints[ptda];
1428 auto idEquals = [](auto id) { return [id] (const auto &e) { return e.id() == id; }; };
1429 if (std::none_of(ptList.cbegin(), ptList.cend(), idEquals(pt.id())))
1430 ptList.append(pt);
1431 };
1432
1433 for (const auto &pt : pe->points()) {
1434 eventStates |= pt.state();
1435 auto epd = QPointingDevicePrivate::get(const_cast<QPointingDevice*>(pe->pointingDevice()))->queryPointById(pt.id());
1436 Q_ASSERT(epd);
1437 bool foundAgent = false;
1438 if (!epd->exclusiveGrabber.isNull() && !epd->exclusiveGrabberContext.isNull()) {
1439 if (auto ptda = qobject_cast<QQuickDeliveryAgent *>(epd->exclusiveGrabberContext.data())) {
1440 insert(ptda, pt);
1441 qCDebug(lcPtr) << pe->type() << "point" << pt.id() << pt.state()
1442 << "@" << pt.scenePosition() << "will be re-delivered via known grabbing agent" << ptda << "to" << epd->exclusiveGrabber.data();
1443 foundAgent = true;
1444 }
1445 }
1446 for (auto pgda : epd->passiveGrabbersContext) {
1447 if (auto ptda = qobject_cast<QQuickDeliveryAgent *>(pgda.data())) {
1448 insert(ptda, pt);
1449 qCDebug(lcPtr) << pe->type() << "point" << pt.id() << pt.state()
1450 << "@" << pt.scenePosition() << "will be re-delivered via known passive-grabbing agent" << ptda;
1451 foundAgent = true;
1452 }
1453 }
1454 // fallback: if we didn't find remembered/known grabber agent(s), expect the root DA to handle it
1455 if (!foundAgent)
1456 insert(da, pt);
1457 }
1458 for (auto daAndPoints : deliveryAgentsNeedingPoints) {
1459 if (pe->pointCount() > 1) {
1461 // if all points have the same state, set the event type accordingly
1462 QEvent::Type eventType = pe->type();
1463 switch (eventStates) {
1465 eventType = QEvent::TouchBegin;
1466 break;
1468 eventType = QEvent::TouchEnd;
1469 break;
1470 default:
1471 eventType = QEvent::TouchUpdate;
1472 break;
1473 }
1474 // Make a new touch event for the subscene, the same way QQuickItemPrivate::localizedTouchEvent() does it
1475 QMutableTouchEvent te(eventType, pe->pointingDevice(), pe->modifiers(), daAndPoints.second);
1476 te.setTimestamp(pe->timestamp());
1477 te.accept();
1478 qCDebug(lcTouch) << daAndPoints.first << "shall now receive" << &te;
1479 ret = daAndPoints.first->event(&te) || ret;
1480 } else {
1481 qCDebug(lcPtr) << daAndPoints.first << "shall now receive" << pe;
1482 ret = daAndPoints.first->event(pe) || ret;
1483 }
1484 }
1485
1486 if (ret)
1487 return true;
1488 } else if (!synthMouse) {
1489 // clear passive grabbers unless it's a system synth-mouse event
1490 // QTBUG-104890: Windows sends synth mouse events (which should be ignored) after touch events
1491 for (const auto &pt : pe->points()) {
1492 if (pt.state() == QEventPoint::Pressed)
1493 pe->clearPassiveGrabbers(pt);
1494 }
1495 }
1496 }
1497
1498 // If it has no points, it's probably a TouchCancel, and DeliveryAgent needs to handle it.
1499 // If we didn't handle it in the block above, handle it now.
1500 // TODO should we deliver to all DAs at once then, since we don't know which one should get it?
1501 // or fix QTBUG-90851 so that the event always has points?
1502 bool ret = (da && da->event(event));
1503
1504 d->clearGrabbers(pe);
1505
1506 if (ret)
1507 return true;
1508 } else if (event->isInputEvent()) {
1509 if (da && da->event(event))
1510 return true;
1511 }
1512
1513 switch (event->type()) {
1514 // a few more types that are not QInputEvents, but QQuickDeliveryAgent needs to handle them anyway
1516 case QEvent::Enter:
1517 case QEvent::Leave:
1520#if QT_CONFIG(quick_draganddrop)
1521 case QEvent::DragEnter:
1522 case QEvent::DragLeave:
1523 case QEvent::DragMove:
1524 case QEvent::Drop:
1525#endif
1526 if (d->inDestructor)
1527 return false;
1528 if (da && da->event(event))
1529 return true;
1530 break;
1533 if (d->contentItem)
1534 QCoreApplication::sendEvent(d->contentItem, event);
1535 break;
1537 if (d->windowManager)
1538 d->windowManager->handleUpdateRequest(this);
1539 break;
1541 if ((static_cast<QPlatformSurfaceEvent *>(event))->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) {
1542 // Ensure that the rendering thread is notified before
1543 // the QPlatformWindow is destroyed.
1544 if (d->windowManager)
1545 d->windowManager->hide(this);
1546 }
1547 break;
1549 if (auto da = d->deliveryAgentPrivate())
1550 da->handleWindowDeactivate(this);
1551 Q_FALLTHROUGH();
1553 if (d->contentItem)
1554 QCoreApplication::sendEvent(d->contentItem, event);
1555 break;
1557 d->inheritPalette(QGuiApplication::palette());
1558 if (d->contentItem)
1559 QCoreApplication::sendEvent(d->contentItem, event);
1560 break;
1562 physicalDpiChanged();
1563 break;
1564 default:
1565 break;
1566 }
1567
1569 update();
1571 d->windowManager->handleContextCreationFailure(this);
1572
1573 if (event->isPointerEvent())
1574 return true;
1575 else
1576 return QWindow::event(event);
1577}
1578
1581{
1582 Q_D(QQuickWindow);
1583 if (d->windowEventDispatch)
1584 return;
1585 auto da = d->deliveryAgentPrivate();
1586 Q_ASSERT(da);
1587 da->deliverKeyEvent(e);
1588}
1589
1592{
1593 Q_D(QQuickWindow);
1594 if (d->windowEventDispatch)
1595 return;
1596 auto da = d->deliveryAgentPrivate();
1597 Q_ASSERT(da);
1598 da->deliverKeyEvent(e);
1599}
1600
1601#if QT_CONFIG(wheelevent)
1603void QQuickWindow::wheelEvent(QWheelEvent *event)
1604{
1605 Q_D(QQuickWindow);
1606 if (d->windowEventDispatch)
1607 return;
1608 auto da = d->deliveryAgentPrivate();
1609 Q_ASSERT(da);
1610 da->deliverSinglePointEventUntilAccepted(event);
1611}
1612#endif // wheelevent
1613
1614#if QT_CONFIG(tabletevent)
1616void QQuickWindow::tabletEvent(QTabletEvent *event)
1617{
1618 Q_D(QQuickWindow);
1619 if (d->windowEventDispatch)
1620 return;
1621 auto da = d->deliveryAgentPrivate();
1622 Q_ASSERT(da);
1623 da->deliverPointerEvent(event);
1624}
1625#endif // tabletevent
1626
1629{
1630 Q_D(QQuickWindow);
1631 if (d->windowEventDispatch)
1632 return;
1633 auto da = d->deliveryAgentPrivate();
1634 Q_ASSERT(da);
1635 da->handleMouseEvent(event);
1636}
1639{
1640 Q_D(QQuickWindow);
1641 if (d->windowEventDispatch)
1642 return;
1643 auto da = d->deliveryAgentPrivate();
1644 Q_ASSERT(da);
1645 da->handleMouseEvent(event);
1646}
1649{
1650 Q_D(QQuickWindow);
1651 if (d->windowEventDispatch)
1652 return;
1653 auto da = d->deliveryAgentPrivate();
1654 Q_ASSERT(da);
1655 da->handleMouseEvent(event);
1656}
1659{
1660 Q_D(QQuickWindow);
1661 if (d->windowEventDispatch)
1662 return;
1663 auto da = d->deliveryAgentPrivate();
1664 Q_ASSERT(da);
1665 da->handleMouseEvent(event);
1666}
1667
1668#if QT_CONFIG(cursor)
1669void QQuickWindowPrivate::updateCursor(const QPointF &scenePos, QQuickItem *rootItem)
1670{
1671 Q_Q(QQuickWindow);
1672 if (!rootItem)
1674 auto cursorItemAndHandler = findCursorItemAndHandler(rootItem, scenePos);
1675 if (cursorItem != cursorItemAndHandler.first || cursorHandler != cursorItemAndHandler.second) {
1677 QWindow *window = renderWindow ? renderWindow : q;
1678 cursorItem = cursorItemAndHandler.first;
1679 cursorHandler = cursorItemAndHandler.second;
1680 if (cursorItem) {
1681 const auto cursor = QQuickItemPrivate::get(cursorItem)->effectiveCursor(cursorHandler);
1682 qCDebug(lcHoverTrace) << "setting cursor" << cursor << "from" << cursorHandler << "or" << cursorItem;
1683 window->setCursor(cursor);
1684 } else {
1685 qCDebug(lcHoverTrace) << "unsetting cursor";
1686 window->unsetCursor();
1687 }
1688 }
1689}
1690
1691QPair<QQuickItem*, QQuickPointerHandler*> QQuickWindowPrivate::findCursorItemAndHandler(QQuickItem *item, const QPointF &scenePos) const
1692{
1694 if (itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) {
1695 QPointF p = item->mapFromScene(scenePos);
1696 if (!item->contains(p))
1697 return {nullptr, nullptr};
1698 }
1699
1700 if (itemPrivate->subtreeCursorEnabled) {
1702 for (int ii = children.size() - 1; ii >= 0; --ii) {
1703 QQuickItem *child = children.at(ii);
1704 if (!child->isVisible() || !child->isEnabled() || QQuickItemPrivate::get(child)->culled)
1705 continue;
1706 auto ret = findCursorItemAndHandler(child, scenePos);
1707 if (ret.first)
1708 return ret;
1709 }
1710 if (itemPrivate->hasCursorHandler) {
1711 if (auto handler = itemPrivate->effectiveCursorHandler()) {
1712 if (handler->parentContains(scenePos))
1713 return {item, handler};
1714 }
1715 }
1716 if (itemPrivate->hasCursor) {
1717 QPointF p = item->mapFromScene(scenePos);
1718 if (item->contains(p))
1719 return {item, nullptr};
1720 }
1721 }
1722
1723 return {nullptr, nullptr};
1724}
1725#endif
1726
1728{
1729 if (auto da = deliveryAgentPrivate())
1730 da->clearFocusObject();
1731}
1732
1758{
1759 if (!o)
1760 return;
1761 QQuickWindow *that = static_cast<QQuickWindow *>(property->object);
1762 if (QQuickWindow *window = qmlobject_cast<QQuickWindow *>(o)) {
1763 qCDebug(lcTransient) << window << "is transient for" << that;
1764 window->setTransientParent(that);
1765 }
1767 itemProperty.append(&itemProperty, o);
1768}
1769
1771{
1772 QQuickWindow *win = static_cast<QQuickWindow*>(property->object);
1773 if (!win || !win->contentItem() || !QQuickItemPrivate::get(win->contentItem())->data().count)
1774 return 0;
1775 QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data();
1776 return itemProperty.count(&itemProperty);
1777}
1778
1780{
1781 QQuickWindow *win = static_cast<QQuickWindow*>(property->object);
1782 QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data();
1783 return itemProperty.at(&itemProperty, i);
1784}
1785
1787{
1788 QQuickWindow *win = static_cast<QQuickWindow*>(property->object);
1789 QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data();
1790 itemProperty.clear(&itemProperty);
1791}
1792
1794{
1795 QQuickWindow *win = static_cast<QQuickWindow*>(property->object);
1796 QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data();
1797 itemProperty.replace(&itemProperty, i, o);
1798}
1799
1801{
1802 QQuickWindow *win = static_cast<QQuickWindow*>(property->object);
1803 QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data();
1804 itemProperty.removeLast(&itemProperty);
1805}
1806
1808{
1809 Q_Q(const QQuickWindow);
1810 return ((q->isExposed() && q->isVisible())) && q->geometry().isValid();
1811}
1812
1814 QString *translatedMessage,
1815 QString *untranslatedMessage)
1816{
1817 const char msg[] = QT_TRANSLATE_NOOP("QQuickWindow",
1818 "Failed to initialize graphics backend for %1.");
1819 *translatedMessage = QQuickWindow::tr(msg).arg(backendName);
1820 *untranslatedMessage = QString::fromLatin1(msg).arg(backendName);
1821}
1822
1824{
1825 for (int ii = 0; ii < cleanupNodeList.size(); ++ii)
1826 delete cleanupNodeList.at(ii);
1828}
1829
1831{
1833 if (p->itemNodeInstance) {
1834 delete p->itemNodeInstance;
1835 p->itemNodeInstance = nullptr;
1836
1837 if (p->extra.isAllocated()) {
1838 p->extra->opacityNode = nullptr;
1839 p->extra->clipNode = nullptr;
1840 p->extra->rootNode = nullptr;
1841 }
1842
1843 p->paintNode = nullptr;
1844
1846 }
1847
1848 // Qt 7: Make invalidateSceneGraph a virtual member of QQuickItem
1849 if (p->flags & QQuickItem::ItemHasContents) {
1850 const QMetaObject *mo = item->metaObject();
1851 int index = mo->indexOfSlot("invalidateSceneGraph()");
1852 if (index >= 0) {
1853 const QMetaMethod &method = mo->method(index);
1854 // Skip functions named invalidateSceneGraph() in QML items.
1855 if (strstr(method.enclosingMetaObject()->className(), "_QML_") == nullptr)
1857 }
1858 }
1859
1860 for (int ii = 0; ii < p->childItems.size(); ++ii)
1861 cleanupNodesOnShutdown(p->childItems.at(ii));
1862}
1863
1864// This must be called from the render thread, with the main thread frozen
1866{
1867 Q_Q(QQuickWindow);
1868 cleanupNodes();
1873 q->cleanupSceneGraph();
1874}
1875
1877{
1878 qCDebug(lcDirty) << "QQuickWindowPrivate::updateDirtyNodes():";
1879
1880 cleanupNodes();
1881
1882 QQuickItem *updateList = dirtyItemList;
1883 dirtyItemList = nullptr;
1884 if (updateList) QQuickItemPrivate::get(updateList)->prevDirtyItem = &updateList;
1885
1886 while (updateList) {
1887 QQuickItem *item = updateList;
1889 itemPriv->removeFromDirtyList();
1890
1891 qCDebug(lcDirty) << " QSGNode:" << item << qPrintable(itemPriv->dirtyToString());
1893 }
1894}
1895
1897{
1898 const QList<QQuickItem *> childItems = d->paintOrderChildItems();
1899 QQuickItem *before = nullptr;
1900 for (int i=0; i<childItems.size(); ++i) {
1901 QQuickItemPrivate *dd = QQuickItemPrivate::get(childItems.at(i));
1902 // Perform the same check as the in fetchNextNode below.
1903 if (dd->z() < 0 && (dd->explicitVisible || (dd->extra.isAllocated() && dd->extra->effectRefCount)))
1904 before = childItems.at(i);
1905 else
1906 break;
1907 }
1908 return Q_UNLIKELY(before) ? QQuickItemPrivate::get(before)->itemNode() : nullptr;
1909}
1910
1911static QSGNode *fetchNextNode(QQuickItemPrivate *itemPriv, int &ii, bool &returnedPaintNode)
1912{
1913 QList<QQuickItem *> orderedChildren = itemPriv->paintOrderChildItems();
1914
1915 for (; ii < orderedChildren.size() && orderedChildren.at(ii)->z() < 0; ++ii) {
1916 QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(orderedChildren.at(ii));
1917 if (!childPrivate->explicitVisible &&
1918 (!childPrivate->extra.isAllocated() || !childPrivate->extra->effectRefCount))
1919 continue;
1920
1921 ii++;
1922 return childPrivate->itemNode();
1923 }
1924
1925 if (itemPriv->paintNode && !returnedPaintNode) {
1926 returnedPaintNode = true;
1927 return itemPriv->paintNode;
1928 }
1929
1930 for (; ii < orderedChildren.size(); ++ii) {
1931 QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(orderedChildren.at(ii));
1932 if (!childPrivate->explicitVisible &&
1933 (!childPrivate->extra.isAllocated() || !childPrivate->extra->effectRefCount))
1934 continue;
1935
1936 ii++;
1937 return childPrivate->itemNode();
1938 }
1939
1940 return nullptr;
1941}
1942
1944{
1946 quint32 dirty = itemPriv->dirtyAttributes;
1947 itemPriv->dirtyAttributes = 0;
1948
1950 (dirty & QQuickItemPrivate::Size && itemPriv->origin() != QQuickItem::TopLeft &&
1951 (itemPriv->scale() != 1. || itemPriv->rotation() != 0.))) {
1952
1954
1955 if (itemPriv->x != 0. || itemPriv->y != 0.)
1956 matrix.translate(itemPriv->x, itemPriv->y);
1957
1958 for (int ii = itemPriv->transforms.size() - 1; ii >= 0; --ii)
1959 itemPriv->transforms.at(ii)->applyTo(&matrix);
1960
1961 if (itemPriv->scale() != 1. || itemPriv->rotation() != 0.) {
1962 QPointF origin = item->transformOriginPoint();
1963 matrix.translate(origin.x(), origin.y());
1964 if (itemPriv->scale() != 1.)
1965 matrix.scale(itemPriv->scale(), itemPriv->scale());
1966 if (itemPriv->rotation() != 0.)
1967 matrix.rotate(itemPriv->rotation(), 0, 0, 1);
1968 matrix.translate(-origin.x(), -origin.y());
1969 }
1970
1971 itemPriv->itemNode()->setMatrix(matrix);
1972 }
1973
1974 const bool clipEffectivelyChanged = dirty & (QQuickItemPrivate::Clip | QQuickItemPrivate::Window);
1975 if (clipEffectivelyChanged) {
1976 QSGNode *parent = itemPriv->opacityNode() ? (QSGNode *)itemPriv->opacityNode()
1977 : (QSGNode *)itemPriv->itemNode();
1978 QSGNode *child = itemPriv->rootNode();
1979
1980 if (bool initializeClipNode = item->clip() && itemPriv->clipNode() == nullptr;
1981 initializeClipNode) {
1982 QQuickDefaultClipNode *clip = new QQuickDefaultClipNode(item->clipRect());
1983 itemPriv->extra.value().clipNode = clip;
1984 clip->update();
1985
1986 if (!child) {
1987 parent->reparentChildNodesTo(clip);
1988 parent->appendChildNode(clip);
1989 } else {
1990 parent->removeChildNode(child);
1991 clip->appendChildNode(child);
1992 parent->appendChildNode(clip);
1993 }
1994
1995 } else if (bool updateClipNode = item->clip() && itemPriv->clipNode() != nullptr;
1996 updateClipNode) {
1997 QQuickDefaultClipNode *clip = itemPriv->clipNode();
1998 clip->setClipRect(item->clipRect());
1999 clip->update();
2000 } else if (bool removeClipNode = !item->clip() && itemPriv->clipNode() != nullptr;
2001 removeClipNode) {
2002 QQuickDefaultClipNode *clip = itemPriv->clipNode();
2003 parent->removeChildNode(clip);
2004 if (child) {
2005 clip->removeChildNode(child);
2006 parent->appendChildNode(child);
2007 } else {
2009 }
2010
2011 delete itemPriv->clipNode();
2012 itemPriv->extra->clipNode = nullptr;
2013 }
2014 }
2015
2016 const int effectRefCount = itemPriv->extra.isAllocated() ? itemPriv->extra->effectRefCount : 0;
2017 const bool effectRefEffectivelyChanged =
2019 && ((effectRefCount == 0) != (itemPriv->rootNode() == nullptr));
2020 if (effectRefEffectivelyChanged) {
2023
2024 QSGNode *parent = itemPriv->clipNode();
2025 if (!parent)
2026 parent = itemPriv->opacityNode();
2027 if (!parent)
2028 parent = itemPriv->itemNode();
2029
2030 if (itemPriv->extra.isAllocated() && itemPriv->extra->effectRefCount) {
2031 Q_ASSERT(itemPriv->rootNode() == nullptr);
2032 QSGRootNode *root = new QSGRootNode();
2033 itemPriv->extra->rootNode = root;
2034 parent->reparentChildNodesTo(root);
2035 parent->appendChildNode(root);
2036 } else {
2037 Q_ASSERT(itemPriv->rootNode() != nullptr);
2038 QSGRootNode *root = itemPriv->rootNode();
2039 parent->removeChildNode(root);
2041 delete itemPriv->rootNode();
2042 itemPriv->extra->rootNode = nullptr;
2043 }
2044 }
2045
2047 int ii = 0;
2048 bool fetchedPaintNode = false;
2049 QList<QQuickItem *> orderedChildren = itemPriv->paintOrderChildItems();
2050 int desiredNodesSize = orderedChildren.size() + (itemPriv->paintNode ? 1 : 0);
2051
2052 // now start making current state match the promised land of
2053 // desiredNodes. in the case of our current state matching desiredNodes
2054 // (though why would we get ChildrenUpdateMask with no changes?) then we
2055 // should make no changes at all.
2056
2057 // how many nodes did we process, when examining changes
2058 int desiredNodesProcessed = 0;
2059
2060 // currentNode is how far, in our present tree, we have processed. we
2061 // make use of this later on to trim the current child list if the
2062 // desired list is shorter.
2063 QSGNode *groupNode = itemPriv->childContainerNode();
2064 QSGNode *currentNode = groupNode->firstChild();
2065 QSGNode *desiredNode = nullptr;
2066
2067 while (currentNode && (desiredNode = fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2068 if (currentNode != desiredNode) {
2069 // uh oh... reality and our utopic paradise are diverging!
2070 // we need to reconcile this...
2071 if (currentNode->nextSibling() == desiredNode) {
2072 // nice and simple: a node was removed, and the next in line is correct.
2073 groupNode->removeChildNode(currentNode);
2074 } else {
2075 // a node needs to be added..
2076 // remove it from any pre-existing parent, and push it before currentNode,
2077 // so it's in the correct place...
2078 if (desiredNode->parent()) {
2079 desiredNode->parent()->removeChildNode(desiredNode);
2080 }
2081 groupNode->insertChildNodeBefore(desiredNode, currentNode);
2082 }
2083
2084 // continue iteration at the correct point, now desiredNode is in place...
2085 currentNode = desiredNode;
2086 }
2087
2088 currentNode = currentNode->nextSibling();
2089 desiredNodesProcessed++;
2090 }
2091
2092 // if we didn't process as many nodes as in the new list, then we have
2093 // more nodes at the end of desiredNodes to append to our list.
2094 // this will be the case when adding new nodes, for instance.
2095 if (desiredNodesProcessed < desiredNodesSize) {
2096 while ((desiredNode = fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2097 if (desiredNode->parent())
2098 desiredNode->parent()->removeChildNode(desiredNode);
2099 groupNode->appendChildNode(desiredNode);
2100 }
2101 } else if (currentNode) {
2102 // on the other hand, if we processed less than our current node
2103 // tree, then nodes have been _removed_ from the scene, and we need
2104 // to take care of that here.
2105 while (currentNode) {
2106 QSGNode *node = currentNode->nextSibling();
2107 groupNode->removeChildNode(currentNode);
2108 currentNode = node;
2109 }
2110 }
2111 }
2112
2113 if ((dirty & QQuickItemPrivate::Size) && itemPriv->clipNode()) {
2114 itemPriv->clipNode()->setRect(item->clipRect());
2115 itemPriv->clipNode()->update();
2116 }
2117
2120 {
2121 qreal opacity = itemPriv->explicitVisible && (!itemPriv->extra.isAllocated() || itemPriv->extra->hideRefCount == 0)
2122 ? itemPriv->opacity() : qreal(0);
2123
2124 if (opacity != 1 && !itemPriv->opacityNode()) {
2125 QSGOpacityNode *node = new QSGOpacityNode;
2126 itemPriv->extra.value().opacityNode = node;
2127
2128 QSGNode *parent = itemPriv->itemNode();
2129 QSGNode *child = itemPriv->clipNode();
2130 if (!child)
2131 child = itemPriv->rootNode();
2132
2133 if (child) {
2134 parent->removeChildNode(child);
2135 node->appendChildNode(child);
2136 parent->appendChildNode(node);
2137 } else {
2138 parent->reparentChildNodesTo(node);
2139 parent->appendChildNode(node);
2140 }
2141 }
2142 if (itemPriv->opacityNode())
2143 itemPriv->opacityNode()->setOpacity(opacity);
2144 }
2145
2147
2148 if (itemPriv->flags & QQuickItem::ItemHasContents) {
2150 itemPriv->paintNode = item->updatePaintNode(itemPriv->paintNode, &updatePaintNodeData);
2151
2152 Q_ASSERT(itemPriv->paintNode == nullptr ||
2153 itemPriv->paintNode->parent() == nullptr ||
2154 itemPriv->paintNode->parent() == itemPriv->childContainerNode());
2155
2156 if (itemPriv->paintNode && itemPriv->paintNode->parent() == nullptr) {
2157 QSGNode *before = qquickitem_before_paintNode(itemPriv);
2158 if (before && before->parent()) {
2159 Q_ASSERT(before->parent() == itemPriv->childContainerNode());
2160 itemPriv->childContainerNode()->insertChildNodeAfter(itemPriv->paintNode, before);
2161 } else {
2162 itemPriv->childContainerNode()->prependChildNode(itemPriv->paintNode);
2163 }
2164 }
2165 } else if (itemPriv->paintNode) {
2166 delete itemPriv->paintNode;
2167 itemPriv->paintNode = nullptr;
2168 }
2169 }
2170
2171#ifndef QT_NO_DEBUG
2172 // Check consistency.
2173
2174 QList<QSGNode *> nodes;
2175 nodes << itemPriv->itemNodeInstance
2176 << itemPriv->opacityNode()
2177 << itemPriv->clipNode()
2178 << itemPriv->rootNode()
2179 << itemPriv->paintNode;
2180 nodes.removeAll(nullptr);
2181
2182 Q_ASSERT(nodes.constFirst() == itemPriv->itemNodeInstance);
2183 for (int i=1; i<nodes.size(); ++i) {
2184 QSGNode *n = nodes.at(i);
2185 // Failing this means we messed up reparenting
2186 Q_ASSERT(n->parent() == nodes.at(i-1));
2187 // Only the paintNode and the one who is childContainer may have more than one child.
2188 Q_ASSERT(n == itemPriv->paintNode || n == itemPriv->childContainerNode() || n->childCount() == 1);
2189 }
2190#endif
2191
2192}
2193
2194bool QQuickWindowPrivate::emitError(QQuickWindow::SceneGraphError error, const QString &msg)
2195{
2196 Q_Q(QQuickWindow);
2197 static const QMetaMethod errorSignal = QMetaMethod::fromSignal(&QQuickWindow::sceneGraphError);
2198 if (q->isSignalConnected(errorSignal)) {
2199 emit q->sceneGraphError(error, msg);
2200 return true;
2201 }
2202 return false;
2203}
2204
2205void QQuickWindow::maybeUpdate()
2206{
2207 Q_D(QQuickWindow);
2208 if (d->renderControl)
2210 else if (d->windowManager)
2211 d->windowManager->maybeUpdate(this);
2212}
2213
2214void QQuickWindow::cleanupSceneGraph()
2215{
2216 Q_D(QQuickWindow);
2217 if (!d->renderer)
2218 return;
2219
2220 delete d->renderer->rootNode();
2221 delete d->renderer;
2222 d->renderer = nullptr;
2223
2224 d->runAndClearJobs(&d->beforeSynchronizingJobs);
2225 d->runAndClearJobs(&d->afterSynchronizingJobs);
2226 d->runAndClearJobs(&d->beforeRenderingJobs);
2227 d->runAndClearJobs(&d->afterRenderingJobs);
2228 d->runAndClearJobs(&d->afterSwapJobs);
2229}
2230
2231void QQuickWindow::setTransientParent_helper(QQuickWindow *window)
2232{
2233 qCDebug(lcTransient) << this << "is transient for" << window;
2234 setTransientParent(window);
2235 disconnect(sender(), SIGNAL(windowChanged(QQuickWindow*)),
2236 this, SLOT(setTransientParent_helper(QQuickWindow*)));
2237}
2238
2240{
2241#if QT_CONFIG(opengl)
2242 if (context && context->isValid()) {
2244 if (rif) {
2245 Q_Q(QQuickWindow);
2247 }
2248 }
2249#endif
2250 return nullptr;
2251}
2252
2256bool QQuickWindow::isSceneGraphInitialized() const
2257{
2258 Q_D(const QQuickWindow);
2259 return d->context != nullptr && d->context->isValid();
2260}
2261
2461void QQuickWindow::setRenderTarget(const QQuickRenderTarget &target)
2462{
2463 Q_D(QQuickWindow);
2464 if (target != d->customRenderTarget) {
2465 d->customRenderTarget = target;
2466 d->redirect.renderTargetDirty = true;
2467 }
2468}
2469
2478QQuickRenderTarget QQuickWindow::renderTarget() const
2479{
2480 Q_D(const QQuickWindow);
2481 return d->customRenderTarget;
2482}
2483
2484#ifdef Q_OS_WEBOS
2485class GrabWindowForProtectedContent : public QRunnable
2486{
2487public:
2488 GrabWindowForProtectedContent(QQuickWindow *window, QImage *image, QWaitCondition *condition)
2489 : m_window(window)
2490 , m_image(image)
2491 , m_condition(condition)
2492 {
2493 }
2494
2495 bool checkGrabbable()
2496 {
2497 if (!m_window)
2498 return false;
2499 if (!m_image)
2500 return false;
2501 if (!QQuickWindowPrivate::get(m_window))
2502 return false;
2503
2504 return true;
2505 }
2506
2507 void run() override
2508 {
2509 if (!checkGrabbable())
2510 return;
2511
2512 *m_image = QSGRhiSupport::instance()->grabOffscreenForProtectedContent(m_window);
2513 if (m_condition)
2514 m_condition->wakeOne();
2515 return;
2516 }
2517
2518private:
2519 QQuickWindow *m_window;
2520 QImage *m_image;
2521 QWaitCondition *m_condition;
2522
2523};
2524#endif
2525
2546QImage QQuickWindow::grabWindow()
2547{
2548 Q_D(QQuickWindow);
2549
2550 if (!d->isRenderable() && !d->renderControl) {
2551 // backends like software can grab regardless of the window state
2552 if (d->windowManager && (d->windowManager->flags() & QSGRenderLoop::SupportsGrabWithoutExpose))
2553 return d->windowManager->grab(this);
2554
2555 if (!isSceneGraphInitialized()) {
2556 // We do not have rendering up and running. Forget the render loop,
2557 // do a frame completely offscreen and synchronously into a
2558 // texture. This can be *very* slow due to all the device/context
2559 // and resource initialization but the documentation warns for it,
2560 // and is still important for some use cases.
2561 Q_ASSERT(!d->rhi);
2562 return QSGRhiSupport::instance()->grabOffscreen(this);
2563 }
2564 }
2565
2566#ifdef Q_OS_WEBOS
2567 if (requestedFormat().testOption(QSurfaceFormat::ProtectedContent)) {
2568 QImage image;
2569 QMutex mutex;
2571 mutex.lock();
2572 GrabWindowForProtectedContent *job = new GrabWindowForProtectedContent(this, &image, &condition);
2573 if (!job) {
2574 qWarning("QQuickWindow::grabWindow: Failed to create a job for capturing protected content");
2575 mutex.unlock();
2576 return QImage();
2577 }
2578 scheduleRenderJob(job, QQuickWindow::NoStage);
2579 condition.wait(&mutex);
2580 mutex.unlock();
2581 return image;
2582 }
2583#endif
2584 // The common case: we have an exposed window with an initialized
2585 // scenegraph, meaning we can request grabbing via the render loop, or we
2586 // are not targeting the window, in which case the request is to be
2587 // forwarded to the rendercontrol.
2588 if (d->renderControl)
2589 return QQuickRenderControlPrivate::get(d->renderControl)->grab();
2590 else if (d->windowManager)
2591 return d->windowManager->grab(this);
2592
2593 return QImage();
2594}
2595
2604QQmlIncubationController *QQuickWindow::incubationController() const
2605{
2606 Q_D(const QQuickWindow);
2607
2608 if (!d->windowManager)
2609 return nullptr; // TODO: make sure that this is safe
2610
2611 if (!d->incubationController)
2612 d->incubationController = new QQuickWindowIncubationController(d->windowManager);
2613 return d->incubationController;
2614}
2615
2616
2617
2983QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image) const
2984{
2985 return createTextureFromImage(image, {});
2986}
2987
2988
3034QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image, CreateTextureOptions options) const
3035{
3036 Q_D(const QQuickWindow);
3037 if (!isSceneGraphInitialized()) // check both for d->context and d->context->isValid()
3038 return nullptr;
3039 uint flags = 0;
3040 if (options & TextureCanUseAtlas) flags |= QSGRenderContext::CreateTexture_Atlas;
3041 if (options & TextureHasMipmaps) flags |= QSGRenderContext::CreateTexture_Mipmap;
3042 if (!(options & TextureIsOpaque)) flags |= QSGRenderContext::CreateTexture_Alpha;
3043 return d->context->createTexture(image, flags);
3044}
3045
3079QSGTexture *QQuickWindow::createTextureFromRhiTexture(QRhiTexture *texture, CreateTextureOptions options) const
3080{
3081 Q_D(const QQuickWindow);
3082 if (!d->rhi)
3083 return nullptr;
3084
3086 t->setOwnsTexture(true);
3087 t->setTexture(texture);
3088 t->setHasAlphaChannel(options & QQuickWindow::TextureHasAlphaChannel);
3089 t->setTextureSize(texture->pixelSize());
3090 return t;
3091}
3092
3093// Legacy, private alternative to createTextureFromRhiTexture() that internally
3094// creates a QRhiTexture wrapping the existing native graphics resource.
3095// New code should prefer using the public API.
3097 int nativeLayoutOrState,
3098 uint nativeFormat,
3099 const QSize &size,
3100 QQuickWindow::CreateTextureOptions options,
3101 TextureFromNativeTextureFlags flags) const
3102{
3103 if (!rhi)
3104 return nullptr;
3105
3107 texture->setTextureFromNativeTexture(rhi, nativeObjectHandle, nativeLayoutOrState, nativeFormat,
3108 size, options, flags);
3109 texture->setHasAlphaChannel(options & QQuickWindow::TextureHasAlphaChannel);
3110 // note that the QRhiTexture does not (and cannot) own the native object
3111 texture->setOwnsTexture(true); // texture meaning the QRhiTexture here, not the native object
3112 texture->setTextureSize(size);
3113 return texture;
3114}
3115
3137void QQuickWindow::setColor(const QColor &color)
3138{
3139 Q_D(QQuickWindow);
3140 if (color == d->clearColor)
3141 return;
3142
3143 if (color.alpha() != d->clearColor.alpha()) {
3144 QSurfaceFormat fmt = requestedFormat();
3145 if (color.alpha() < 255)
3146 fmt.setAlphaBufferSize(8);
3147 else
3148 fmt.setAlphaBufferSize(-1);
3149 setFormat(fmt);
3150 }
3151 d->clearColor = color;
3153 update();
3154}
3155
3157{
3158 return d_func()->clearColor;
3159}
3160
3167bool QQuickWindow::hasDefaultAlphaBuffer()
3168{
3170}
3171
3181void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
3182{
3184}
3185
3249const QQuickWindow::GraphicsStateInfo &QQuickWindow::graphicsStateInfo()
3250{
3251 Q_D(QQuickWindow);
3252 if (d->rhi) {
3253 d->rhiStateInfo.currentFrameSlot = d->rhi->currentFrameSlot();
3254 d->rhiStateInfo.framesInFlight = d->rhi->resourceLimit(QRhi::FramesInFlight);
3255 }
3256 return d->rhiStateInfo;
3257}
3258
3300void QQuickWindow::beginExternalCommands()
3301{
3302 Q_D(QQuickWindow);
3303 if (d->rhi && d->context && d->context->isValid()) {
3304 QSGDefaultRenderContext *rc = static_cast<QSGDefaultRenderContext *>(d->context);
3306 if (cb)
3307 cb->beginExternal();
3308 }
3309}
3310
3337void QQuickWindow::endExternalCommands()
3338{
3339 Q_D(QQuickWindow);
3340 if (d->rhi && d->context && d->context->isValid()) {
3341 QSGDefaultRenderContext *rc = static_cast<QSGDefaultRenderContext *>(d->context);
3343 if (cb)
3344 cb->endExternal();
3345 }
3346}
3347
3797void QQuickWindow::scheduleRenderJob(QRunnable *job, RenderStage stage)
3798{
3799 Q_D(QQuickWindow);
3800
3801 d->renderJobMutex.lock();
3802 if (stage == BeforeSynchronizingStage) {
3803 d->beforeSynchronizingJobs << job;
3804 } else if (stage == AfterSynchronizingStage) {
3805 d->afterSynchronizingJobs << job;
3806 } else if (stage == BeforeRenderingStage) {
3807 d->beforeRenderingJobs << job;
3808 } else if (stage == AfterRenderingStage) {
3809 d->afterRenderingJobs << job;
3810 } else if (stage == AfterSwapStage) {
3811 d->afterSwapJobs << job;
3812 } else if (stage == NoStage) {
3813 if (d->renderControl && d->rhi && d->rhi->thread() == QThread::currentThread()) {
3814 job->run();
3815 delete job;
3816 } else if (isExposed()) {
3817 d->windowManager->postJob(this, job);
3818 } else {
3819 delete job;
3820 }
3821 }
3822 d->renderJobMutex.unlock();
3823}
3824
3826{
3828 QList<QRunnable *> jobList = *jobs;
3829 jobs->clear();
3831
3832 for (QRunnable *r : std::as_const(jobList)) {
3833 r->run();
3834 delete r;
3835 }
3836}
3837
3838void QQuickWindow::runJobsAfterSwap()
3839{
3840 Q_D(QQuickWindow);
3841 d->runAndClearJobs(&d->afterSwapJobs);
3842}
3843
3859qreal QQuickWindow::effectiveDevicePixelRatio() const
3860{
3861 Q_D(const QQuickWindow);
3863 if (w)
3864 return w->devicePixelRatio();
3865
3866 if (!d->customRenderTarget.isNull())
3867 return d->customRenderTarget.devicePixelRatio();
3868
3869 return devicePixelRatio();
3870}
3871
3893QSGRendererInterface *QQuickWindow::rendererInterface() const
3894{
3895 Q_D(const QQuickWindow);
3896
3897 // no context validity check - it is essential to be able to return a
3898 // renderer interface instance before scenegraphInitialized() is emitted
3899 // (depending on the backend, that can happen way too late for some of the
3900 // rif use cases, like examining the graphics api or shading language in
3901 // use)
3902
3903 return d->context->sceneGraphContext()->rendererInterface(d->context);
3904}
3905
3926QRhi *QQuickWindow::rhi() const
3927{
3928 Q_D(const QQuickWindow);
3929 return d->rhi;
3930}
3931
3942QRhiSwapChain *QQuickWindow::swapChain() const
3943{
3944 Q_D(const QQuickWindow);
3945 return d->swapchain;
3946}
3947
3994void QQuickWindow::setGraphicsApi(QSGRendererInterface::GraphicsApi api)
3995{
3996 // Special cases: these are different scenegraph backends.
3997 switch (api) {
3999 setSceneGraphBackend(QStringLiteral("software"));
4000 break;
4002 setSceneGraphBackend(QStringLiteral("openvg"));
4003 break;
4004 default:
4005 break;
4006 }
4007
4008 // Standard case: tell the QRhi-based default adaptation what graphics api
4009 // (QRhi backend) to use.
4012}
4013
4043QSGRendererInterface::GraphicsApi QQuickWindow::graphicsApi()
4044{
4045 // Note that this applies the settings e.g. from the env vars
4046 // (QSG_RHI_BACKEND) if it was not done at least once already. Whereas if
4047 // setGraphicsApi() was called before, or the scene graph is already
4048 // initialized, then this is just a simple query.
4050}
4051
4072void QQuickWindow::setSceneGraphBackend(const QString &backend)
4073{
4074 QSGContext::setBackend(backend);
4075}
4076
4089QString QQuickWindow::sceneGraphBackend()
4090{
4091 return QSGContext::backend();
4092}
4093
4157void QQuickWindow::setGraphicsDevice(const QQuickGraphicsDevice &device)
4158{
4159 Q_D(QQuickWindow);
4160 d->customDeviceObjects = device;
4161}
4162
4171QQuickGraphicsDevice QQuickWindow::graphicsDevice() const
4172{
4173 Q_D(const QQuickWindow);
4174 return d->customDeviceObjects;
4175}
4176
4204void QQuickWindow::setGraphicsConfiguration(const QQuickGraphicsConfiguration &config)
4205{
4206 Q_D(QQuickWindow);
4207 d->graphicsConfig = config;
4208}
4209
4218QQuickGraphicsConfiguration QQuickWindow::graphicsConfiguration() const
4219{
4220 Q_D(const QQuickWindow);
4221 return d->graphicsConfig;
4222}
4223
4232QSGRectangleNode *QQuickWindow::createRectangleNode() const
4233{
4234 Q_D(const QQuickWindow);
4235 return isSceneGraphInitialized() ? d->context->sceneGraphContext()->createRectangleNode() : nullptr;
4236}
4237
4246QSGImageNode *QQuickWindow::createImageNode() const
4247{
4248 Q_D(const QQuickWindow);
4249 return isSceneGraphInitialized() ? d->context->sceneGraphContext()->createImageNode() : nullptr;
4250}
4251
4257QSGNinePatchNode *QQuickWindow::createNinePatchNode() const
4258{
4259 Q_D(const QQuickWindow);
4260 return isSceneGraphInitialized() ? d->context->sceneGraphContext()->createNinePatchNode() : nullptr;
4261}
4262
4271QQuickWindow::TextRenderType QQuickWindow::textRenderType()
4272{
4274}
4275
4286void QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType renderType)
4287{
4289}
4290
4291
4309
4311#ifndef QT_NO_DEBUG_STREAM
4313{
4314 QDebugStateSaver saver(debug);
4315 debug.nospace();
4316 if (!win) {
4317 debug << "QQuickWindow(nullptr)";
4318 return debug;
4319 }
4320
4321 debug << win->metaObject()->className() << '(' << static_cast<const void *>(win);
4322 if (win->isActive())
4323 debug << " active";
4324 if (win->isExposed())
4325 debug << " exposed";
4326 debug << ", visibility=" << win->visibility() << ", flags=" << win->flags();
4327 if (!win->title().isEmpty())
4328 debug << ", title=" << win->title();
4329 if (!win->objectName().isEmpty())
4330 debug << ", name=" << win->objectName();
4331 if (win->parent())
4332 debug << ", parent=" << static_cast<const void *>(win->parent());
4333 if (win->transientParent())
4334 debug << ", transientParent=" << static_cast<const void *>(win->transientParent());
4335 debug << ", geometry=";
4337 debug << ')';
4338 return debug;
4339}
4340#endif
4341
4343
4344#include "qquickwindow.moc"
4345#include "moc_qquickwindow_p.cpp"
4346#include "moc_qquickwindow.cpp"
IOBluetoothDevice * device
\inmodule QtCore
void stopped()
This signal is emitted by the animation framework to notify the driver that continuous animation has ...
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:561
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
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)
\inmodule QtCore
\inmodule QtCore
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
\inmodule QtCore
Definition qcoreevent.h:45
bool isSinglePointEvent() const noexcept
Definition qcoreevent.h:310
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
@ ApplicationPaletteChange
Definition qcoreevent.h:93
@ DevicePixelRatioChange
Definition qcoreevent.h:287
@ FocusAboutToChange
Definition qcoreevent.h:68
@ InputMethod
Definition qcoreevent.h:120
@ DragEnter
Definition qcoreevent.h:101
@ LocaleChange
Definition qcoreevent.h:122
@ InputMethodQuery
Definition qcoreevent.h:261
@ TouchUpdate
Definition qcoreevent.h:242
@ TouchBegin
Definition qcoreevent.h:241
@ WindowActivate
Definition qcoreevent.h:83
@ LanguageChange
Definition qcoreevent.h:123
@ UpdateRequest
Definition qcoreevent.h:113
@ DragLeave
Definition qcoreevent.h:103
@ PlatformSurface
Definition qcoreevent.h:278
@ WindowDeactivate
Definition qcoreevent.h:84
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Definition qcoreevent.h:305
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
Definition qevent.h:514
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
Qt::FocusReason reason() const
Returns the reason for this focus event.
Definition qevent.cpp:1566
static void cleanup()
Definition qfont.cpp:2220
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise,...
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
QList< QGraphicsItem * > childItems() const
QPointF transformOriginPoint() const
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
This method is only relevant for input items.
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
GraphicsItemFlags flags() const
Returns this item's flags.
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate sy...
\macro qGuiApp
QScreen * primaryScreen
the primary (or default) screen of the application.
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,...
void applicationStateChanged(Qt::ApplicationState state)
void fontDatabaseChanged()
This signal is emitted when the available fonts have changed.
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:585
\inmodule QtGui
Definition qimage.h:37
static void setObjectOwnership(QObject *, ObjectOwnership)
Sets the ownership of object.
The QKeyEvent class describes a key event.
Definition qevent.h:423
QString arg(Args &&...args) const
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
qsizetype removeAll(const AT &t)
Definition qlist.h:575
const T & constFirst() const noexcept
Definition qlist.h:630
void append(parameter_type t)
Definition qlist.h:441
void clear()
Definition qlist.h:417
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore
Definition qmetaobject.h:18
static QMetaMethod fromSignal(PointerToMemberFunction signal)
\inmodule QtGui
Definition qevent.h:195
\inmodule QtCore
Definition qmutex.h:285
void unlock() noexcept
Unlocks the mutex.
Definition qmutex.h:293
void lock() noexcept
Locks the mutex.
Definition qmutex.h:290
QObject * q_ptr
Definition qobject.h:60
QObjectList children
Definition qobject.h:62
QObject * parent
Definition qobject.h:61
\inmodule QtCore
Definition qobject.h:90
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
Definition qobject.cpp:1792
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition qobject.cpp:2521
QString objectName
the name of this object
Definition qobject.h:94
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2142
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
Definition qobject.h:114
void killTimer(int id)
Kills the timer with timer identifier, id.
Definition qobject.cpp:1872
\inmodule QtGui
int width() const
int height() const
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
The QPlatformSurfaceEvent class is used to notify about native platform surface events....
Definition qevent.h:530
\inmodule QtCore\reentrant
Definition qpoint.h:214
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:333
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:338
\inmodule QtCore\reentrant
Definition qpoint.h:23
A base class for pointer events.
Definition qevent.h:73
virtual bool isEndEvent() const
Definition qevent.h:91
void setTimestamp(quint64 timestamp) override
Definition qevent.cpp:335
void clearPassiveGrabbers(const QEventPoint &point)
Removes all passive grabbers from the given point.
Definition qevent.cpp:430
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
Definition qevent.cpp:366
QEventPoint & point(qsizetype i)
Returns a QEventPoint reference for the point at index i.
Definition qevent.cpp:237
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
Definition qevent.h:86
\inmodule QtCore
Definition qpointer.h:18
EventPointData * queryPointById(int id) const
static QPointingDevicePrivate * get(QPointingDevice *q)
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
static const QPointingDevice * primaryPointingDevice(const QString &seatName=QString())
Returns the primary pointing device (the core pointer, traditionally assumed to be a mouse) on the gi...
QQmlIncubationController instances drive the progress of QQmlIncubators.
void incubateFor(int msecs)
Incubate objects for msecs, or until there are no more objects to incubate.
int incubatingObjectCount() const
Return the number of objects currently incubating.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
ClearFunction clear
Definition qqmllist.h:87
AtFunction at
Definition qqmllist.h:86
RemoveLastFunction removeLast
Definition qqmllist.h:89
CountFunction count
Definition qqmllist.h:85
AppendFunction append
Definition qqmllist.h:84
ReplaceFunction replace
Definition qqmllist.h:88
static QString prettyTypeName(const QObject *object)
Returns the pretty QML type name (e.g.
\qmlsignal QtQuick::Window::sceneGraphError(SceneGraphError error, QString message)
void setAccepted(bool accepted)
void setRect(const QRectF &)
static bool isTabletEvent(const QPointerEvent *ev)
static bool isSynthMouse(const QPointerEvent *ev)
static bool isTouchEvent(const QPointerEvent *ev)
bool event(QEvent *ev) override
Handle ev on behalf of this delivery agent's window or subscene.
QQuickGraphicsConfiguration controls lower level graphics settings for the QQuickWindow.
The QQuickGraphicsDevice class provides an opaque container for native graphics objects representing ...
QQuickItem ** prevDirtyItem
QLazilyAllocated< ExtraData, ExtraDataTags > extra
virtual void updatePolish()
QList< QQuickItem * > paintOrderChildItems() const
QSGOpacityNode * opacityNode() const
quint32 subtreeCursorEnabled
QQuickDefaultClipNode * clipNode() const
QSGTransformNode * itemNodeInstance
QString dirtyToString() const
void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &)
QSGNode * childContainerNode()
void dirty(DirtyType)
qreal z() const
qreal rotation() const
QList< QQuickTransform * > transforms
QQuickWindow * window
qreal opacity() const
QQuickItem::TransformOrigin origin() const
qreal scale() const
QSGTransformNode * itemNode()
QSGRootNode * rootNode() const
QQmlListProperty< QObject > data()
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
void setSize(const QSizeF &size)
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
@ ItemDevicePixelRatioHasChanged
Definition qquickitem.h:153
@ ItemClipsChildrenToShape
Definition qquickitem.h:129
void inheritPalette(const QPalette &parentPalette)
static void purgeCache()
static QQuickRenderControlPrivate * get(QQuickRenderControl *renderControl)
The QQuickRenderControl class provides a mechanism for rendering the Qt Quick scenegraph onto an offs...
static QWindow * renderWindowFor(QQuickWindow *win, QPoint *offset=nullptr)
Returns the real window that win is being rendered to, if any.
static QQuickRenderTargetPrivate * get(QQuickRenderTarget *rt)
bool resolve(QRhi *rhi, QQuickWindowRenderTarget *dst)
The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a ...
virtual void invalidate()=0
virtual void applyTo(QMatrix4x4 *matrix) const =0
void incubatingObjectCountChanged(int count) override
Called when the number of incubating objects changes.
void timerEvent(QTimerEvent *) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QQuickWindowIncubationController(QSGRenderLoop *loop)
~QQuickWindowPrivate() override
void init(QQuickWindow *, QQuickRenderControl *control=nullptr)
QByteArray visualizationMode
QRhiRenderPassDescriptor * rpDescForSwapchain
bool emitError(QQuickWindow::SceneGraphError error, const QString &msg)
QQuickItem::UpdatePaintNodeData updatePaintNodeData
static void data_clear(QQmlListProperty< QObject > *)
QQuickGraphicsConfiguration graphicsConfig
static void data_replace(QQmlListProperty< QObject > *, qsizetype, QObject *)
QQuickRootItem * contentItem
void dirtyItem(QQuickItem *)
QList< QRunnable * > beforeRenderingJobs
void clearFocusObject() override
static QQuickWindowPrivate * get(QQuickWindow *c)
static QQuickWindow::TextRenderType textRenderType
QSGRenderContext * context
QSGRenderer * renderer
QQuickRenderControl * renderControl
void runAndClearJobs(QList< QRunnable * > *jobs)
QList< QRunnable * > beforeSynchronizingJobs
QVector< QQuickItem * > itemsToPolish
QQuickItem * dirtyItemList
void updateDirtyNode(QQuickItem *)
void clearGrabbers(QPointerEvent *event)
static void rhiCreationFailureMessage(const QString &backendName, QString *translatedMessage, QString *untranslatedMessage)
static void emitBeforeRenderPassRecording(void *ud)
static bool defaultAlphaBuffer
QQuickRenderTarget customRenderTarget
void setCustomCommandBuffer(QRhiCommandBuffer *cb)
static void data_append(QQmlListProperty< QObject > *, QObject *)
\qmlproperty list<QtObject> Window::data \qmldefault
void invalidateFontData(QQuickItem *item)
void cleanup(QSGNode *)
QQuickDeliveryAgentPrivate * deliveryAgentPrivate() const
QQmlListProperty< QObject > data()
QSet< QQuickItem * > parentlessItems
void updateChildrenPalettes(const QPalette &parentPalette) override
qreal lastReportedItemDevicePixelRatio
QScopedPointer< QQuickAnimatorController > animationController
QRhiSwapChain * swapchain
QSGTexture * createTextureFromNativeTexture(quint64 nativeObjectHandle, int nativeLayoutOrState, uint nativeFormat, const QSize &size, QQuickWindow::CreateTextureOptions options, TextureFromNativeTextureFlags flags={}) const
void forcePolish()
Schedules polish events on all items in the scene.
static void data_removeLast(QQmlListProperty< QObject > *)
struct QQuickWindowPrivate::Redirect redirect
static void emitAfterRenderPassRecording(void *ud)
QSGRenderLoop * windowManager
bool isRenderable() const
QList< QSGNode * > cleanupNodeList
QOpenGLContext * openglContext()
QQuickDeliveryAgent * deliveryAgent
QList< QRunnable * > afterRenderingJobs
QList< QRunnable * > afterSynchronizingJobs
static QObject * data_at(QQmlListProperty< QObject > *, qsizetype)
static qsizetype data_count(QQmlListProperty< QObject > *)
QRhiRenderPassDescriptor * rpDesc
QRhiRenderBuffer * renderBuffer
QRhiRenderBuffer * depthStencil
QRhiRenderTarget * renderTarget
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
void focusOutEvent(QFocusEvent *) override
\reimp
void frameSwapped()
This signal is emitted when a frame has been queued for presenting.
void mousePressEvent(QMouseEvent *) override
\reimp
void resizeEvent(QResizeEvent *) override
\reimp
void update()
Schedules the window to render another frame.
void mouseReleaseEvent(QMouseEvent *) override
\reimp
void exposeEvent(QExposeEvent *) override
\reimp
QQuickItem * contentItem
\qmlattachedproperty Item Window::contentItem
void focusInEvent(QFocusEvent *) override
\reimp
void sceneGraphInitialized()
\qmlsignal QtQuick::Window::frameSwapped()
bool event(QEvent *) override
\reimp
QColor color
\qmlproperty color Window::color
void closeEvent(QCloseEvent *) override
\reimp
~QQuickWindow() override
Destroys the window.
void sceneGraphInvalidated()
\qmlsignal QtQuick::Window::sceneGraphInitialized()
void mouseMoveEvent(QMouseEvent *) override
\reimp
QQuickItem * activeFocusItem
The item which currently has active focus or null if there is no item with active focus.
QObject * focusObject() const override
void releaseResources()
This function tries to release redundant resources currently held by the QML scene.
void hideEvent(QHideEvent *) override
\reimp
void showEvent(QShowEvent *) override
\reimp
void keyReleaseEvent(QKeyEvent *) override
\reimp
void mouseDoubleClickEvent(QMouseEvent *) override
\reimp
void keyPressEvent(QKeyEvent *) override
\reimp
void colorChanged(const QColor &)
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore\reentrant
Definition qrect.h:30
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:547
const QSize & size() const
Returns the new size of the widget.
Definition qevent.h:552
\inmodule QtGui
Definition qrhi.h:1614
\inmodule QtGui
Definition qrhi.h:1119
\inmodule QtGui
Definition qrhi.h:1135
virtual QSize pixelSize() const =0
QRhiRenderPassDescriptor * renderPassDescriptor() const
Definition qrhi.h:1141
\inmodule QtGui
Definition qrhi.h:1513
QSize currentPixelSize() const
Definition qrhi.h:1559
virtual QRhiRenderTarget * currentFrameRenderTarget()=0
virtual QRhiCommandBuffer * currentFrameCommandBuffer()=0
\inmodule QtGui
Definition qrhi.h:883
\inmodule QtGui
Definition qrhi.h:1767
bool isYUpInNDC() const
Definition qrhi.cpp:9615
@ FramesInFlight
Definition qrhi.h:1850
\inmodule QtCore
Definition qrunnable.h:18
virtual void run()=0
Implement this pure virtual function in your subclass.
void setViewportRect(const QRect &rect)
Sets rect as the geometry of the viewport to render on the surface.
void setProjectionMatrixToRect(const QRectF &rect)
Convenience method that calls setProjectionMatrix() with an orthographic matrix generated from rect.
void setDeviceRect(const QRect &rect)
Sets rect as the geometry of the surface being rendered to.
void setClearColor(const QColor &color)
Use color to clear the framebuffer when clearMode() is set to QSGAbstractRenderer::ClearColorBuffer.
void setClearMode(ClearMode mode)
Defines which attachment of the framebuffer should be cleared before each scene render with the mode ...
void setRootNode(QSGRootNode *node)
Sets the node as the root of the QSGNode scene that you want to render.
void setClipRect(const QRectF &)
Sets the clip rect of this clip node to rect.
Definition qsgnode.cpp:1099
The QSGContext holds the scene graph entry points for one QML engine.
static QString backend()
virtual QSGRendererInterface * rendererInterface(QSGRenderContext *renderContext)
Returns a pointer to the (presumably) global renderer interface.
static void setBackend(const QString &backend)
virtual QSurfaceFormat defaultSurfaceFormat() const =0
QRhiCommandBuffer * currentFrameCommandBuffer() const
The QSGImageNode class is provided for convenience to easily draw textured content using the QML scen...
\inmodule QtQuick
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
void removeChildNode(QSGNode *node)
Removes node from this node's list of children.
Definition qsgnode.cpp:498
QSGNode * nextSibling() const
Returns the node after this in the parent's list of children.
Definition qsgnode.h:107
void prependChildNode(QSGNode *node)
Prepends node to this node's the list of children.
Definition qsgnode.cpp:365
void reparentChildNodesTo(QSGNode *newParent)
Definition qsgnode.cpp:545
int childCount() const
Returns the number of child nodes.
Definition qsgnode.cpp:554
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
Definition qsgnode.cpp:396
void insertChildNodeBefore(QSGNode *node, QSGNode *before)
Inserts node to this node's list of children before the node specified with before.
Definition qsgnode.cpp:429
void insertChildNodeAfter(QSGNode *node, QSGNode *after)
Inserts node to this node's list of children after the node specified with after.
Definition qsgnode.cpp:465
QSGNode * parent() const
Returns the parent node of this node.
Definition qsgnode.h:93
QSGNode * firstChild() const
Returns the first child of this node.
Definition qsgnode.h:105
void removeAllChildNodes()
Removes all child nodes from this node's list of children.
Definition qsgnode.cpp:525
The QSGOpacityNode class is used to change opacity of nodes.
Definition qsgnode.h:279
void setOpacity(qreal opacity)
Sets the opacity of this node to opacity.
Definition qsgnode.cpp:1310
void setTextureFromNativeTexture(QRhi *rhi, quint64 nativeObjectHandle, int nativeLayoutOrState, uint nativeFormat, const QSize &size, QQuickWindow::CreateTextureOptions options, QQuickWindowPrivate::TextureFromNativeTextureFlags flags)
void setOwnsTexture(bool owns)
The QSGRectangleNode class is a convenience class for drawing solid filled rectangles using scenegrap...
virtual void endNextFrame(QSGRenderer *renderer)
virtual void beginNextFrame(QSGRenderer *renderer, const QSGRenderTarget &renderTarget, RenderPassCallback mainPassRecordingStart, RenderPassCallback mainPassRecordingEnd, void *callbackUserData)
virtual void invalidateGlyphCaches()
virtual QSGRenderer * createRenderer(QSGRendererInterface::RenderMode renderMode=QSGRendererInterface::RenderMode2D)=0
QSGContext * sceneGraphContext() const
virtual void renderNextFrame(QSGRenderer *renderer)=0
virtual void prepareSync(qreal devicePixelRatio, QRhiCommandBuffer *cb, const QQuickGraphicsConfiguration &config)
virtual bool isValid() const
static QSGRenderLoop * instance()
void timeToIncubate()
void addWindow(QQuickWindow *win)
virtual QAnimationDriver * animationDriver() const =0
virtual QSurface::SurfaceType windowSurfaceType() const
virtual QSGRenderContext * createRenderContext(QSGContext *) const =0
virtual QSGContext * sceneGraphContext() const =0
virtual bool interleaveIncubation() const
An interface providing access to some of the graphics API specific internals of the scenegraph.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
static bool isApiRhiBased(GraphicsApi api)
virtual void * getResource(QQuickWindow *window, Resource resource) const
Queries a graphics resource in window.
GraphicsApi
\value Unknown An unknown graphics API is in use \value Software The Qt Quick 2D Renderer is in use \...
virtual bool hasVisualizationModeWithContinuousUpdate() const
void setDevicePixelRatio(qreal ratio)
virtual void setVisualizationMode(const QByteArray &)
static QSGRhiSupport * instance_internal()
QSGRendererInterface::GraphicsApi graphicsApi() const
void configure(QSGRendererInterface::GraphicsApi api)
QImage grabOffscreen(QQuickWindow *window)
static QSGRhiSupport * instance()
The QSGRootNode is the toplevel root of any scene graph.
Definition qsgnode.h:262
\inmodule QtQuick
Definition qsgtexture.h:20
void setMatrix(const QMatrix4x4 &matrix)
Sets this transform node's matrix to matrix.
Definition qsgnode.cpp:1160
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
iterator begin()
Definition qset.h:136
iterator end()
Definition qset.h:140
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:577
A base class for pointer events containing a single point, such as mouse events.
Definition qevent.h:108
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5710
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition qstring.h:898
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8606
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
@ OpenGLSurface
Definition qsurface.h:32
static QThread * currentThread()
Definition qthread.cpp:966
\inmodule QtCore
Definition qcoreevent.h:359
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition qwidget.h:106
QCursor cursor
Definition qwindow_p.h:142
qreal devicePixelRatio
Definition qwindow_p.h:111
\inmodule QtGui
Definition qwindow.h:63
virtual QAccessibleInterface * accessibleRoot() const
Returns the accessibility interface for the object that the window represents.
Definition qwindow.cpp:2150
void focusObjectChanged(QObject *object)
This signal is emitted when the final receiver of events tied to focus is changed to object.
virtual bool event(QEvent *) override
Override this to handle any event (ev) sent to the window.
Definition qwindow.cpp:2433
void screenChanged(QScreen *screen)
This signal is emitted when a window's screen changes, either by being set explicitly with setScreen(...
widget setFormat(format)
qDeleteAll(list.begin(), list.end())
double e
cache insert(employee->id(), employee)
QSet< QString >::iterator it
auto mo
[7]
else opt state
[0]
Combined button and popup list for selecting options.
static void formatQRect(QDebug &debug, const Rect &rect)
Definition qdebug_p.h:45
@ ImEnabled
@ NoButton
Definition qnamespace.h:56
@ AA_SynthesizeMouseForUnhandledTabletEvents
Definition qnamespace.h:458
ApplicationState
Definition qnamespace.h:261
@ ApplicationActive
Definition qnamespace.h:265
@ DirectConnection
Definition image.cpp:4
static void * context
#define Q_FALLTHROUGH()
#define Q_UNLIKELY(x)
#define Q_LIKELY(x)
std::pair< T1, T2 > QPair
#define qApp
DBusConnection const char DBusError * error
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 * method
EGLConfig config
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
static QString backendName
#define qWarning
Definition qlogging.h:162
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
return ret
const char * typeName
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
#define SLOT(a)
Definition qobjectdefs.h:51
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLenum mode
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLenum condition
GLboolean r
[2]
GLenum GLuint id
[7]
GLenum GLenum GLsizei count
GLenum target
GLbitfield flags
GLenum GLuint texture
GLfloat n
struct _cl_event * event
const GLubyte * c
GLuint GLenum matrix
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
QQuickItem * qmlobject_cast< QQuickItem * >(QObject *object)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
const QQuickItem * rootItem(const I &item)
void qtquick_shadereffect_purge_gui_thread_shader_cache()
static void updatePixelRatioHelper(QQuickItem *item, float pixelRatio)
void forcePolishHelper(QQuickItem *item)
void forceUpdate(QQuickItem *item)
QDebug operator<<(QDebug debug, const QQuickWindow *win)
static QSGNode * qquickitem_before_paintNode(QQuickItemPrivate *d)
static QSGNode * fetchNextNode(QQuickItemPrivate *itemPriv, int &ii, bool &returnedPaintNode)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define qPrintable(string)
Definition qstring.h:1391
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define QStringLiteral(str)
QScreen * screen
[1]
Definition main.cpp:29
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define Q_OBJECT
#define slots
#define emit
#define Q_UNUSED(x)
#define QT_TRANSLATE_NOOP(scope, x)
unsigned int quint32
Definition qtypes.h:45
unsigned long long quint64
Definition qtypes.h:56
ptrdiff_t qsizetype
Definition qtypes.h:70
unsigned int uint
Definition qtypes.h:29
double qreal
Definition qtypes.h:92
QVideoFrameFormat::PixelFormat fmt
const char property[13]
Definition qwizard.cpp:101
QWidget * win
Definition settings.cpp:6
QObject::connect nullptr
myObject disconnect()
[26]
QMutex mutex
[2]
QGraphicsItem * item
QList< QTreeWidgetItem * > items
QLayoutItem * child
[0]
aWidget window() -> setWindowTitle("New Window Title")
[2]
QSvgRenderer * renderer
[0]
bool check(QQuickItem *item, int itemsRemainingBeforeUpdatePolish)
const QVector< QQuickItem * > & itemsToPolish
PolishLoopDetector(const QVector< QQuickItem * > &itemsToPolish)
bool contains(const AT &t) const noexcept
Definition qlist.h:44
\inmodule QtCore
QSGTransformNode * transformNode
Definition qquickitem.h:368
QRhiCommandBuffer * commandBuffer
QQuickWindowRenderTarget rt
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent