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>
22#include <private/qguiapplication_p.h>
24#include <private/qabstractanimation_p.h>
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>
39#include <QtQuick/private/qquickpixmapcache_p.h>
41#include <private/qqmldebugserviceinterfaces_p.h>
42#include <private/qqmldebugconnector_p.h>
43#include <private/qsgdefaultrendercontext_p.h>
45#include <private/qopengl_p.h>
46#include <QOpenGLContext>
48#ifndef QT_NO_DEBUG_STREAM
49#include <private/qdebug_p.h>
65#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE)
77 : m_renderLoop(loop), m_timer(0)
83 if (animationDriver) {
129 int m_incubation_time;
133#if QT_CONFIG(accessibility)
140 return QAccessible::queryAccessibleInterface(
const_cast<QQuickWindow*
>(
this));
175 if (
d->windowManager)
176 d->windowManager->exposureChanged(
this);
184 d->contentItem->setSize(ev->
size());
185 if (
d->windowManager)
186 d->windowManager->resize(
this);
193 if (
d->windowManager)
194 d->windowManager->show(
this);
201 if (
auto da =
d->deliveryAgentPrivate())
202 da->handleWindowHidden(
this);
203 if (
d->windowManager)
204 d->windowManager->hide(
this);
221 d->contentItem->setFocus(
false, ev->
reason());
231 d->contentItem->setFocus(
true, ev->
reason());
232 if (
auto da =
d->deliveryAgentPrivate())
233 da->updateFocusItemTransform();
285 if (
itemsToPolish.size() > itemsRemainingBeforeUpdatePolish) {
311 qmlWarning(guiltyItem) << typeAndObjectName(guiltyItem)
312 <<
" called polish() inside updatePolish() of " << typeAndObjectName(
item);
346 item->updatePolish();
347 if (polishLoopDetector.
check(
item, itemsRemaining) ==
true)
352 if (
QQuickItem *focusItem = q_func()->activeFocusItem()) {
358 if (isActiveFocusItem && hasImEnabled && transformDirtyOnItemOrAncestor(focusItem))
374 if (
d->windowManager)
375 d->windowManager->update(
this);
376 else if (
d->renderControl)
392void QQuickWindow::physicalDpiChanged()
395 const qreal newPixelRatio = effectiveDevicePixelRatio();
396 if (
qFuzzyCompare(newPixelRatio,
d->lastReportedItemDevicePixelRatio))
398 d->lastReportedItemDevicePixelRatio = newPixelRatio;
404void QQuickWindow::handleFontDatabaseChanged()
407 d->pendingFontUpdate =
true;
476 if (textItem !=
nullptr)
525 emit q->beforeSynchronizing();
564 emit q->afterSynchronizing();
571 emit w->beforeRenderPassRecording();
577 emit w->afterRenderPassRecording();
597 qWarning(
"Custom render target is set but no renderpass descriptor has been provided.");
602 qWarning(
"Custom render target is set but no command buffer has been provided.");
607 qWarning(
"QQuickWindow: No render target (neither swapchain nor custom target was provided)");
626 emit q->beforeRendering();
629 QSGAbstractRenderer::MatrixTransformFlags matrixFlags;
654 emit q->afterRendering();
670 , lastReportedItemDevicePixelRatio(0)
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)
693 service->removeWindow(q_func());
700 if (
auto root =
q->contentItem()) {
701 for (
auto &&
child: root->childItems()) {
719 contentItemPrivate->
window =
q;
738 &QQuickWindow::handleFontDatabaseChanged);
747 sg = renderControlPriv->
sg;
774 service->addWindow(
q);
781 auto da =
d->deliveryAgentPrivate();
783 da->handleWindowDeactivate(
this);
813QQuickItem *QQuickWindow::mouseGrabberItem()
const
820 if (
auto epd = da->mousePointData())
823 if (
Q_LIKELY(
d->deliveryAgentPrivate()->eventsInDelivery.isEmpty()))
825 qCDebug(lcMouse,
"mouse grabber ambiguous: no event is currently being delivered");
830 firstPointExclusiveGrabber());
1078 d->init(
this, control);
1088 d->init(
this, control);
1097 d->inDestructor =
true;
1098 if (
d->renderControl) {
1100 }
else if (
d->windowManager) {
1101 d->windowManager->removeWindow(
this);
1102 d->windowManager->windowDestroyed(
this);
1105 delete d->incubationController;
d->incubationController =
nullptr;
1107 d->contentItem =
nullptr;
1110 d->deliveryAgent =
nullptr;
1112 d->renderJobMutex.lock();
1114 d->beforeSynchronizingJobs.clear();
1116 d->afterSynchronizingJobs.clear();
1118 d->beforeRenderingJobs.clear();
1120 d->afterRenderingJobs.clear();
1122 d->afterSwapJobs.clear();
1123 d->renderJobMutex.unlock();
1133#if QT_CONFIG(quick_shadereffect)
1166 if (
d->windowManager)
1167 d->windowManager->releaseResources(
this);
1169#if QT_CONFIG(quick_shadereffect)
1204void QQuickWindow::setPersistentGraphics(
bool persistent)
1207 d->persistentGraphics = persistent;
1221bool QQuickWindow::isPersistentGraphics()
const
1224 return d->persistentGraphics;
1251void QQuickWindow::setPersistentSceneGraph(
bool persistent)
1254 d->persistentSceneGraph = persistent;
1267bool QQuickWindow::isPersistentSceneGraph()
const
1270 return d->persistentSceneGraph;
1294 return d->contentItem;
1308 auto da =
d->deliveryAgentPrivate();
1310 return da->activeFocusItem;
1320 auto da =
d->deliveryAgentPrivate();
1322 if (!
d->inDestructor && da->activeFocusItem)
1323 return da->activeFocusItem;
1347 auto &firstPt = pointerEvent->
point(0);
1352 for (
auto &point : pointerEvent->
points()) {
1369 if (
event->isPointerEvent()) {
1380 if (
d->windowEventDispatch)
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)
1415 if (pe->pointCount()) {
1422 QEventPoint::States eventStates;
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())))
1433 for (
const auto &pt : pe->points()) {
1434 eventStates |= pt.state();
1437 bool foundAgent =
false;
1438 if (!epd->exclusiveGrabber.isNull() && !epd->exclusiveGrabberContext.isNull()) {
1439 if (
auto ptda = qobject_cast<QQuickDeliveryAgent *>(epd->exclusiveGrabberContext.data())) {
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();
1446 for (
auto pgda : epd->passiveGrabbersContext) {
1447 if (
auto ptda = qobject_cast<QQuickDeliveryAgent *>(pgda.data())) {
1449 qCDebug(lcPtr) << pe->type() <<
"point" << pt.id() << pt.state()
1450 <<
"@" << pt.scenePosition() <<
"will be re-delivered via known passive-grabbing agent" << ptda;
1458 for (
auto daAndPoints : deliveryAgentsNeedingPoints) {
1459 if (pe->pointCount() > 1) {
1463 switch (eventStates) {
1475 QMutableTouchEvent te(eventType, pe->pointingDevice(), pe->modifiers(), daAndPoints.second);
1478 qCDebug(lcTouch) << daAndPoints.first <<
"shall now receive" << &te;
1479 ret = daAndPoints.first->event(&te) ||
ret;
1481 qCDebug(lcPtr) << daAndPoints.first <<
"shall now receive" << pe;
1482 ret = daAndPoints.first->event(pe) ||
ret;
1488 }
else if (!synthMouse) {
1491 for (
const auto &pt : pe->points()) {
1493 pe->clearPassiveGrabbers(pt);
1504 d->clearGrabbers(pe);
1508 }
else if (
event->isInputEvent()) {
1513 switch (
event->type()) {
1520#if QT_CONFIG(quick_draganddrop)
1526 if (
d->inDestructor)
1537 if (
d->windowManager)
1538 d->windowManager->handleUpdateRequest(
this);
1544 if (
d->windowManager)
1545 d->windowManager->hide(
this);
1549 if (
auto da =
d->deliveryAgentPrivate())
1550 da->handleWindowDeactivate(
this);
1562 physicalDpiChanged();
1571 d->windowManager->handleContextCreationFailure(
this);
1573 if (
event->isPointerEvent())
1583 if (
d->windowEventDispatch)
1585 auto da =
d->deliveryAgentPrivate();
1587 da->deliverKeyEvent(
e);
1594 if (
d->windowEventDispatch)
1596 auto da =
d->deliveryAgentPrivate();
1598 da->deliverKeyEvent(
e);
1601#if QT_CONFIG(wheelevent)
1603void QQuickWindow::wheelEvent(QWheelEvent *
event)
1606 if (
d->windowEventDispatch)
1608 auto da =
d->deliveryAgentPrivate();
1610 da->deliverSinglePointEventUntilAccepted(
event);
1614#if QT_CONFIG(tabletevent)
1616void QQuickWindow::tabletEvent(QTabletEvent *
event)
1619 if (
d->windowEventDispatch)
1621 auto da =
d->deliveryAgentPrivate();
1623 da->deliverPointerEvent(
event);
1631 if (
d->windowEventDispatch)
1633 auto da =
d->deliveryAgentPrivate();
1635 da->handleMouseEvent(
event);
1641 if (
d->windowEventDispatch)
1643 auto da =
d->deliveryAgentPrivate();
1645 da->handleMouseEvent(
event);
1651 if (
d->windowEventDispatch)
1653 auto da =
d->deliveryAgentPrivate();
1655 da->handleMouseEvent(
event);
1661 if (
d->windowEventDispatch)
1663 auto da =
d->deliveryAgentPrivate();
1665 da->handleMouseEvent(
event);
1668#if QT_CONFIG(cursor)
1674 auto cursorItemAndHandler = findCursorItemAndHandler(
rootItem, scenePos);
1675 if (cursorItem != cursorItemAndHandler.first || cursorHandler != cursorItemAndHandler.second) {
1678 cursorItem = cursorItemAndHandler.first;
1679 cursorHandler = cursorItemAndHandler.second;
1682 qCDebug(lcHoverTrace) <<
"setting cursor" <<
cursor <<
"from" << cursorHandler <<
"or" << cursorItem;
1685 qCDebug(lcHoverTrace) <<
"unsetting cursor";
1697 return {
nullptr,
nullptr};
1706 auto ret = findCursorItemAndHandler(
child, scenePos);
1711 if (
auto handler = itemPrivate->effectiveCursorHandler()) {
1712 if (handler->parentContains(scenePos))
1713 return {
item, handler};
1719 return {
item,
nullptr};
1723 return {
nullptr,
nullptr};
1730 da->clearFocusObject();
1763 qCDebug(lcTransient) <<
window <<
"is transient for" << that;
1764 window->setTransientParent(that);
1767 itemProperty.
append(&itemProperty,
o);
1776 return itemProperty.
count(&itemProperty);
1783 return itemProperty.
at(&itemProperty,
i);
1790 itemProperty.
clear(&itemProperty);
1797 itemProperty.
replace(&itemProperty,
i,
o);
1810 return ((
q->isExposed() &&
q->isVisible())) &&
q->geometry().isValid();
1818 "Failed to initialize graphics backend for %1.");
1833 if (
p->itemNodeInstance) {
1834 delete p->itemNodeInstance;
1835 p->itemNodeInstance =
nullptr;
1837 if (
p->extra.isAllocated()) {
1838 p->extra->opacityNode =
nullptr;
1839 p->extra->clipNode =
nullptr;
1840 p->extra->rootNode =
nullptr;
1843 p->paintNode =
nullptr;
1851 int index =
mo->indexOfSlot(
"invalidateSceneGraph()");
1855 if (strstr(
method.enclosingMetaObject()->className(),
"_QML_") ==
nullptr)
1860 for (
int ii = 0; ii <
p->childItems.size(); ++ii)
1873 q->cleanupSceneGraph();
1878 qCDebug(lcDirty) <<
"QQuickWindowPrivate::updateDirtyNodes():";
1886 while (updateList) {
1900 for (
int i=0;
i<childItems.
size(); ++
i) {
1904 before = childItems.
at(
i);
1915 for (; ii < orderedChildren.
size() && orderedChildren.
at(ii)->z() < 0; ++ii) {
1918 (!childPrivate->
extra.isAllocated() || !childPrivate->
extra->effectRefCount))
1925 if (itemPriv->
paintNode && !returnedPaintNode) {
1926 returnedPaintNode =
true;
1930 for (; ii < orderedChildren.
size(); ++ii) {
1933 (!childPrivate->
extra.isAllocated() || !childPrivate->
extra->effectRefCount))
1955 if (itemPriv->x != 0. || itemPriv->y != 0.)
1956 matrix.translate(itemPriv->x, itemPriv->y);
1961 if (itemPriv->
scale() != 1. || itemPriv->
rotation() != 0.) {
1963 matrix.translate(origin.
x(), origin.
y());
1964 if (itemPriv->
scale() != 1.)
1968 matrix.translate(-origin.
x(), -origin.
y());
1975 if (clipEffectivelyChanged) {
1980 if (
bool initializeClipNode =
item->clip() && itemPriv->
clipNode() ==
nullptr;
1981 initializeClipNode) {
1983 itemPriv->
extra.value().clipNode = clip;
1987 parent->reparentChildNodesTo(clip);
1988 parent->appendChildNode(clip);
1992 parent->appendChildNode(clip);
1995 }
else if (
bool updateClipNode =
item->clip() && itemPriv->
clipNode() !=
nullptr;
2000 }
else if (
bool removeClipNode = !
item->clip() && itemPriv->
clipNode() !=
nullptr;
2003 parent->removeChildNode(clip);
2012 itemPriv->
extra->clipNode =
nullptr;
2016 const int effectRefCount = itemPriv->
extra.isAllocated() ? itemPriv->
extra->effectRefCount : 0;
2017 const bool effectRefEffectivelyChanged =
2019 && ((effectRefCount == 0) != (itemPriv->
rootNode() ==
nullptr));
2020 if (effectRefEffectivelyChanged) {
2030 if (itemPriv->
extra.isAllocated() && itemPriv->
extra->effectRefCount) {
2033 itemPriv->
extra->rootNode = root;
2034 parent->reparentChildNodesTo(root);
2035 parent->appendChildNode(root);
2039 parent->removeChildNode(root);
2042 itemPriv->
extra->rootNode =
nullptr;
2048 bool fetchedPaintNode =
false;
2050 int desiredNodesSize = orderedChildren.
size() + (itemPriv->
paintNode ? 1 : 0);
2058 int desiredNodesProcessed = 0;
2065 QSGNode *desiredNode =
nullptr;
2067 while (currentNode && (desiredNode =
fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2068 if (currentNode != desiredNode) {
2078 if (desiredNode->
parent()) {
2085 currentNode = desiredNode;
2089 desiredNodesProcessed++;
2095 if (desiredNodesProcessed < desiredNodesSize) {
2096 while ((desiredNode =
fetchNextNode(itemPriv, ii, fetchedPaintNode))) {
2097 if (desiredNode->
parent())
2101 }
else if (currentNode) {
2105 while (currentNode) {
2126 itemPriv->
extra.value().opacityNode = node;
2136 parent->appendChildNode(node);
2138 parent->reparentChildNodesTo(node);
2139 parent->appendChildNode(node);
2158 if (before && before->
parent()) {
2183 for (
int i=1;
i<nodes.
size(); ++
i) {
2198 if (
q->isSignalConnected(errorSignal)) {
2205void QQuickWindow::maybeUpdate()
2208 if (
d->renderControl)
2210 else if (
d->windowManager)
2211 d->windowManager->maybeUpdate(
this);
2214void QQuickWindow::cleanupSceneGraph()
2220 delete d->renderer->rootNode();
2222 d->renderer =
nullptr;
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);
2233 qCDebug(lcTransient) <<
this <<
"is transient for" <<
window;
2234 setTransientParent(
window);
2241#if QT_CONFIG(opengl)
2256bool QQuickWindow::isSceneGraphInitialized()
const
2259 return d->context !=
nullptr &&
d->context->isValid();
2464 if (
target !=
d->customRenderTarget) {
2465 d->customRenderTarget =
target;
2466 d->redirect.renderTargetDirty =
true;
2481 return d->customRenderTarget;
2485class GrabWindowForProtectedContent :
public QRunnable
2495 bool checkGrabbable()
2509 if (!checkGrabbable())
2514 m_condition->wakeOne();
2546QImage QQuickWindow::grabWindow()
2550 if (!
d->isRenderable() && !
d->renderControl) {
2553 return d->windowManager->grab(
this);
2555 if (!isSceneGraphInitialized()) {
2572 GrabWindowForProtectedContent *job =
new GrabWindowForProtectedContent(
this, &
image, &
condition);
2574 qWarning(
"QQuickWindow::grabWindow: Failed to create a job for capturing protected content");
2578 scheduleRenderJob(job, QQuickWindow::NoStage);
2588 if (
d->renderControl)
2590 else if (
d->windowManager)
2591 return d->windowManager->grab(
this);
2608 if (!
d->windowManager)
2611 if (!
d->incubationController)
2613 return d->incubationController;
2985 return createTextureFromImage(
image, {});
3034QSGTexture *QQuickWindow::createTextureFromImage(
const QImage &
image, CreateTextureOptions options)
const
3037 if (!isSceneGraphInitialized())
3088 t->setHasAlphaChannel(options & QQuickWindow::TextureHasAlphaChannel);
3089 t->setTextureSize(
texture->pixelSize());
3097 int nativeLayoutOrState,
3100 QQuickWindow::CreateTextureOptions options,
3101 TextureFromNativeTextureFlags
flags)
const
3109 texture->setHasAlphaChannel(options & QQuickWindow::TextureHasAlphaChannel);
3111 texture->setOwnsTexture(
true);
3140 if (
color ==
d->clearColor)
3143 if (
color.alpha() !=
d->clearColor.alpha()) {
3145 if (
color.alpha() < 255)
3146 fmt.setAlphaBufferSize(8);
3148 fmt.setAlphaBufferSize(-1);
3158 return d_func()->clearColor;
3167bool QQuickWindow::hasDefaultAlphaBuffer()
3181void QQuickWindow::setDefaultAlphaBuffer(
bool useAlpha)
3249const QQuickWindow::GraphicsStateInfo &QQuickWindow::graphicsStateInfo()
3253 d->rhiStateInfo.currentFrameSlot =
d->rhi->currentFrameSlot();
3256 return d->rhiStateInfo;
3300void QQuickWindow::beginExternalCommands()
3303 if (
d->rhi &&
d->context &&
d->context->isValid()) {
3307 cb->beginExternal();
3337void QQuickWindow::endExternalCommands()
3340 if (
d->rhi &&
d->context &&
d->context->isValid()) {
3797void QQuickWindow::scheduleRenderJob(
QRunnable *job, RenderStage stage)
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) {
3816 }
else if (isExposed()) {
3817 d->windowManager->postJob(
this, job);
3822 d->renderJobMutex.unlock();
3832 for (
QRunnable *
r : std::as_const(jobList)) {
3838void QQuickWindow::runJobsAfterSwap()
3841 d->runAndClearJobs(&
d->afterSwapJobs);
3859qreal QQuickWindow::effectiveDevicePixelRatio()
const
3864 return w->devicePixelRatio();
3866 if (!
d->customRenderTarget.isNull())
3867 return d->customRenderTarget.devicePixelRatio();
3869 return devicePixelRatio();
3903 return d->context->sceneGraphContext()->rendererInterface(
d->context);
3926QRhi *QQuickWindow::rhi()
const
3945 return d->swapchain;
4072void QQuickWindow::setSceneGraphBackend(
const QString &backend)
4089QString QQuickWindow::sceneGraphBackend()
4160 d->customDeviceObjects =
device;
4174 return d->customDeviceObjects;
4221 return d->graphicsConfig;
4235 return isSceneGraphInitialized() ?
d->context->sceneGraphContext()->createRectangleNode() :
nullptr;
4249 return isSceneGraphInitialized() ?
d->context->sceneGraphContext()->createImageNode() :
nullptr;
4260 return isSceneGraphInitialized() ?
d->context->sceneGraphContext()->createNinePatchNode() :
nullptr;
4271QQuickWindow::TextRenderType QQuickWindow::textRenderType()
4286void QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType renderType)
4311#ifndef QT_NO_DEBUG_STREAM
4317 debug <<
"QQuickWindow(nullptr)";
4321 debug <<
win->metaObject()->className() <<
'(' <<
static_cast<const void *
>(
win);
4322 if (
win->isActive())
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();
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=";
4344#include "qquickwindow.moc"
4345#include "moc_qquickwindow_p.cpp"
4346#include "moc_qquickwindow.cpp"
IOBluetoothDevice * device
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.
The QColor class provides colors based on RGB, HSV or CMYK values.
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)
The QEventPoint class provides information about a point in a QPointerEvent.
bool isSinglePointEvent() const noexcept
Type
This enum type defines the valid event types in Qt.
@ ApplicationPaletteChange
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
The QFocusEvent class contains event parameters for widget focus events.
Qt::FocusReason reason() const
Returns the reason for this focus event.
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...
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.
static void setObjectOwnership(QObject *, ObjectOwnership)
Sets the ownership of object.
The QKeyEvent class describes a key event.
QString arg(Args &&...args) const
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
const T & constFirst() const noexcept
void append(parameter_type t)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
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...
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
QString objectName
the name of this object
void setParent(QObject *parent)
Makes the object a child of parent.
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
void killTimer(int id)
Kills the timer with timer identifier, id.
The QPalette class contains color groups for each widget state.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
A base class for pointer events.
virtual bool isEndEvent() const
void setTimestamp(quint64 timestamp) override
void clearPassiveGrabbers(const QEventPoint &point)
Removes all passive grabbers from the given point.
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
QEventPoint & point(qsizetype i)
Returns a QEventPoint reference for the point at index i.
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
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...
RemoveLastFunction removeLast
void windowNodesDestroyed()
\qmlsignal QtQuick::Window::sceneGraphError(SceneGraphError error, QString message)
void setAccepted(bool accepted)
void setRect(const QRectF &)
static bool subsceneAgentsExist
static bool isTabletEvent(const QPointerEvent *ev)
void updateFocusItemTransform()
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.
bool isDepthBufferEnabledFor2D() const
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 removeFromDirtyList()
QList< QQuickTransform * > transforms
QQuickItem::TransformOrigin origin() 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}.
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
@ ItemClipsChildrenToShape
void inheritPalette(const QPalette &parentPalette)
QPalette parentPalette(const QPalette &fallbackPalette) const override
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 ...
bool mirrorVertically() const
virtual void invalidate()=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 > *)
@ TriggerContextCreationFailure
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
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 cleanupNodesOnShutdown()
void setCustomCommandBuffer(QRhiCommandBuffer *cb)
static void data_append(QQmlListProperty< QObject > *, QObject *)
\qmlproperty list<QtObject> Window::data \qmldefault
void ensureCustomRenderTarget()
void invalidateFontData(QQuickItem *item)
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
QPaintDevice * paintDevice
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
\inmodule QtCore\reentrant
The QResizeEvent class contains event parameters for resize events.
const QSize & size() const
Returns the new size of the widget.
virtual QSize pixelSize() const =0
QRhiRenderPassDescriptor * renderPassDescriptor() const
QSize currentPixelSize() const
virtual QRhiRenderTarget * currentFrameRenderTarget()=0
virtual QRhiCommandBuffer * currentFrameCommandBuffer()=0
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.
The QSGContext holds the scene graph entry points for one QML engine.
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...
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void removeChildNode(QSGNode *node)
Removes node from this node's list of children.
QSGNode * nextSibling() const
Returns the node after this in the parent's list of children.
void prependChildNode(QSGNode *node)
Prepends node to this node's the list of children.
void reparentChildNodesTo(QSGNode *newParent)
int childCount() const
Returns the number of child nodes.
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
void insertChildNodeBefore(QSGNode *node, QSGNode *before)
Inserts node to this node's list of children before the node specified with before.
void insertChildNodeAfter(QSGNode *node, QSGNode *after)
Inserts node to this node's list of children after the node specified with after.
QSGNode * parent() const
Returns the parent node of this node.
QSGNode * firstChild() const
Returns the first child of this node.
void removeAllChildNodes()
Removes all child nodes from this node's list of children.
The QSGOpacityNode class is used to change opacity of nodes.
void setOpacity(qreal opacity)
Sets the opacity of this node to opacity.
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 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
@ SupportsGrabWithoutExpose
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...
@ RenderMode2DNoDepthBuffer
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.
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.
The QShowEvent class provides an event that is sent when a widget is shown.
A base class for pointer events containing a single point, such as mouse events.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QThread * currentThread()
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
static bool platformSynthesizesMouse
virtual QAccessibleInterface * accessibleRoot() const
Returns the accessibility interface for the object that the window represents.
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.
void screenChanged(QScreen *screen)
This signal is emitted when a window's screen changes, either by being set explicitly with setScreen(...
qDeleteAll(list.begin(), list.end())
cache insert(employee->id(), employee)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static void formatQRect(QDebug &debug, const Rect &rect)
@ AA_SynthesizeMouseForUnhandledTabletEvents
std::pair< T1, T2 > QPair
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
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLdouble GLdouble GLdouble GLdouble q
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)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define QT_TRANSLATE_NOOP(scope, x)
unsigned long long quint64
QVideoFrameFormat::PixelFormat fmt
myObject disconnect()
[26]
QSvgRenderer * renderer
[0]
bool check(QQuickItem *item, int itemsRemainingBeforeUpdatePolish)
const QVector< QQuickItem * > & itemsToPolish
int numPolishLoopsInSequence
PolishLoopDetector(const QVector< QQuickItem * > &itemsToPolish)
bool contains(const AT &t) const noexcept
QSGTransformNode * transformNode
QRhiCommandBuffer * commandBuffer
QQuickWindowRenderTarget rt
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent