8#include <QtQml/qjsengine.h>
14#include <QtQml/qqmlengine.h>
15#include <QtQml/qqmlcomponent.h>
16#include <QtQml/qqmlinfo.h>
17#include <QtGui/qpen.h>
18#include <QtGui/qguiapplication.h>
19#include <QtGui/qstylehints.h>
20#include <QtGui/private/qeventpoint_p.h>
21#include <QtGui/private/qguiapplication_p.h>
22#include <QtGui/private/qpointingdevice_p.h>
23#include <QtGui/qinputmethod.h>
24#include <QtCore/qcoreevent.h>
25#include <QtCore/private/qnumeric_p.h>
26#include <QtGui/qpa/qplatformtheme.h>
27#include <QtCore/qloggingcategory.h>
28#include <QtCore/private/qduplicatetracker_p.h>
30#include <private/qqmlglobal_p.h>
31#include <private/qqmlengine_p.h>
32#include <QtQuick/private/qquickstategroup_p.h>
33#include <private/qqmlopenmetaobject_p.h>
34#include <QtQuick/private/qquickstate_p.h>
35#include <private/qquickitem_p.h>
36#include <QtQuick/private/qquickaccessibleattached_p.h>
37#include <QtQuick/private/qquickhoverhandler_p.h>
38#include <QtQuick/private/qquickpointerhandler_p.h>
39#include <QtQuick/private/qquickpointerhandler_p_p.h>
41#include <private/qv4engine_p.h>
42#include <private/qv4object_p.h>
43#include <private/qv4qobjectwrapper_p.h>
44#include <private/qdebug_p.h>
45#include <private/qqmlvaluetypewrapper_p.h>
48# include <QtGui/qcursor.h>
76 <<
item->hasActiveFocus()
77 <<
item->isFocusScope()
83 item->isFocusScope() || !scope ?
item : scope,
129 for (
int ii = 0; ii <
d->items.size(); ++ii) {
131 p->transforms.removeOne(
this);
139 for (
int ii = 0; ii <
d->items.size(); ++ii) {
153 for (
int i = 0;
i < children.
size(); ++
i) {
159bool QQuickContents::calcHeight(
QQuickItem *changed)
161 qreal oldy = m_contents.
y();
175 qreal top = std::numeric_limits<qreal>::max();
178 for (
int i = 0;
i < children.
size(); ++
i) {
191 return (m_contents.
height() != oldheight || m_contents.
y() != oldy);
194bool QQuickContents::calcWidth(
QQuickItem *changed)
196 qreal oldx = m_contents.
x();
210 qreal left = std::numeric_limits<qreal>::max();
211 qreal right = -std::numeric_limits<qreal>::max();
213 for (
int i = 0;
i < children.
size(); ++
i) {
226 return (m_contents.
width() != oldwidth || m_contents.
x() != oldx);
234 for (
int i = 0;
i < children.
size(); ++
i) {
242void QQuickContents::updateRect()
250 bool wChanged =
false;
251 bool hChanged =
false;
254 wChanged = calcWidth();
256 hChanged = calcHeight();
257 if (wChanged || hChanged)
287 m_next =
p->extra.value().keyHandler;
288 p->extra->keyHandler =
this;
310 m_next->inputMethodEvent(
event, post);
317 if (m_next)
return m_next->inputMethodQuery(
query);
442 if (
d->leftSet &&
d->left ==
i)
444 d->leftSet =
d->left !=
i;
447 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
464 if (
d->rightSet &&
d->right ==
i)
466 d->rightSet =
d->right !=
i;
469 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
486 if (
d->upSet &&
d->up ==
i)
488 d->upSet =
d->up !=
i;
491 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
508 if (
d->downSet &&
d->down ==
i)
510 d->downSet =
d->down !=
i;
513 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
530 if (
d->tabSet &&
d->tab ==
i)
532 d->tabSet =
d->tab !=
i;
535 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
552 if (
d->backtabSet &&
d->backtab ==
i)
554 d->backtabSet =
d->backtab !=
i;
557 qobject_cast<QQuickKeyNavigationAttached*>(qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(
i));
603 switch (
event->key()) {
666 switch (
event->key()) {
670 if (mirror ?
d->right :
d->left)
676 if (mirror ?
d->left :
d->right)
706void QQuickKeyNavigationAttached::setFocusNavigation(
QQuickItem *currentItem,
const char *
dir,
710 bool isNextItem =
false;
718 qmlAttachedPropertiesObject<QQuickKeyNavigationAttached>(currentItem,
false);
722 visitedItems.
append(currentItem);
723 currentItem = tempItem;
729 while (currentItem != initialItem && isNextItem && !visitedItems.
contains(currentItem));
773 keySignal =
"digit0Pressed";
784bool QQuickKeysAttached::isConnected(
const char *signalName)
const
787 int signal_index =
d->signalIndex(signalName);
788 return d->isSignalConnected(signal_index);
1227 qWarning() <<
"Could not attach Keys property to: " <<
parent <<
" is not an Item";
1253 for (
int ii = 0; ii <
d->targets.size(); ++ii) {
1255 if (targetItem && (targetItem->
flags() & QQuickItem::ItemAcceptsInputMethod)) {
1256 d->item->setFlag(QQuickItem::ItemAcceptsInputMethod);
1274 if (
d->item &&
d->item->window()) {
1276 for (
int ii = 0; ii <
d->targets.size(); ++ii) {
1278 if (
i &&
i->isVisible()) {
1281 if (
event->isAccepted()) {
1294 keySignal +=
"(QQuickKeyEvent*)";
1295 if (isConnected(keySignal)) {
1298 int idx = QQuickKeysAttached::staticMetaObject.indexOfSignal(keySignal);
1318 if (
d->item &&
d->item->window()) {
1319 d->inRelease =
true;
1320 for (
int ii = 0; ii <
d->targets.size(); ++ii) {
1322 if (
i &&
i->isVisible()) {
1325 if (
event->isAccepted()) {
1326 d->inRelease =
false;
1331 d->inRelease =
false;
1348 for (
int ii = 0; ii <
d->targets.size(); ++ii) {
1350 if (targetItem && targetItem->
isVisible() && (targetItem->
flags() & QQuickItem::ItemAcceptsInputMethod)) {
1352 if (
event->isAccepted()) {
1353 d->imeItem = targetItem;
1361 QQuickItemKeyFilter::inputMethodEvent(
event, post);
1368 for (
int ii = 0; ii <
d->targets.size(); ++ii) {
1370 if (
i &&
i->isVisible() && (
i->flags() & QQuickItem::ItemAcceptsInputMethod) &&
i ==
d->imeItem) {
1373 if (
v.userType() == QMetaType::QRectF)
1374 v =
d->item->mapRectFromItem(
i,
v.toRectF());
1379 return QQuickItemKeyFilter::inputMethodQuery(
query);
1482 itemPrivate->
extra.value().layoutDirectionAttached =
this;
1484 qmlWarning(
parent) <<
tr(
"LayoutDirection attached property only works with Items and Windows");
1574 if (
extra.isAllocated() &&
extra->layoutDirectionAttached) {
1575 emit extra->layoutDirectionAttached->enabledChanged();
1632 itemPrivate->
extra.value().enterKeyAttached =
this;
1649 if (keyType !=
type) {
1678 if (oldSubFocusItem) {
1680 while (sfi && sfi != scope) {
1689 while (sfi && sfi != scope) {
2313 d->inDestructor =
true;
2315 if (
d->windowRefCount > 1)
2316 d->windowRefCount = 1;
2323 child->setParentItem(
nullptr);
2324 d->childItems.clear();
2341 d->changeListeners.clear();
2348 for (
int ii = 0; ii <
d->transforms.size(); ++ii) {
2354 if (
d->extra.isAllocated()) {
2355 delete d->extra->contents;
d->extra->contents =
nullptr;
2356#if QT_CONFIG(quick_shadereffect)
2357 delete d->extra->layer;
d->extra->layer =
nullptr;
2361 delete d->_anchors;
d->_anchors =
nullptr;
2362 delete d->_stateGroup;
d->_stateGroup =
nullptr;
2364 d->isQuickItem =
false;
2378#if QT_CONFIG(accessibility)
2380 if (role == QAccessible::EditableText || role == QAccessible::Table || role == QAccessible::List) {
2382 }
else if (role == QAccessible::ComboBox || role == QAccessible::SpinBox) {
2383 if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(
item))
2384 return iface->state().editable;
2390 return editable.
toBool();
2393 if (readonly.
isValid() && !readonly.
toBool() &&
item->property(
"text").isValid())
2424 qWarning() <<
"QQuickItemPrivate::nextTabChildItem called with null item.";
2429 if (start < 0 || start >=
count) {
2430 qWarning() <<
"QQuickItemPrivate::nextTabChildItem: Start index value out of range for item" <<
item;
2435 if (!
child->d_func()->isTabFence)
2445 qWarning() <<
"QQuickItemPrivate::prevTabChildItem called with null item.";
2452 if (start < 0 || start >=
count) {
2453 qWarning() <<
"QQuickItemPrivate::prevTabChildItem: Start index value out of range for item" <<
item;
2456 while (
start >= 0) {
2458 if (!
child->d_func()->isTabFence)
2468 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: item:" <<
item <<
", forward:" << forward;
2497 while (startItem && !startItem->
isVisible()) {
2505 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: startItem:" << startItem;
2506 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: firstFromItem:" << firstFromItem;
2509 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: current:" << current;
2510 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: from:" << from;
2520 hasChildren =
false;
2529 if (hasChildren && from == current->
parentItem()) {
2531 current = firstChild;
2533 current = lastChild;
2537 }
else if (hasChildren && forward && from != lastChild) {
2541 }
else if (hasChildren && !forward && from != firstChild) {
2553 if (last != firstSibling
2554 || (
parent->isFocusScope() &&
parent->activeFocusOnTab() &&
parent->hasActiveFocus()))
2558 }
else if (hasChildren) {
2561 current = firstChild;
2563 current = lastChild;
2576 if (((current == startItem || current == originalStartItem) && from == firstFromItem) ||
2577 (!skip && cycleDetector.
hasSeen(current))) {
2579 if (
item == contentItem) {
2580 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem";
2583 qCDebug(lcFocus) <<
"QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return " << startItem;
2587 if (!firstFromItem) {
2588 if (startItem->d_func()->isTabFence) {
2589 if (current == startItem)
2590 firstFromItem = from;
2592 startItem = current;
2593 firstFromItem = from;
2629 return d->parentItem;
2640 while (itemAncestor !=
nullptr) {
2642 qWarning() <<
"QQuickItem::setParentItem: Parent" <<
parentItem <<
"is already part of the subtree of" <<
this;
2649 d->removeFromDirtyList();
2654 if (oldParentItem) {
2660 scopeFocusedItem =
this;
2662 scopeFocusedItem =
d->subFocusItem;
2664 if (scopeFocusedItem) {
2665 scopeItem = oldParentItem;
2669 d->deliveryAgentPrivate()->
2672 if (scopeFocusedItem !=
this)
2683 }
else if (
d->window) {
2688 bool alreadyAddedChild =
false;
2689 if (
d->window == parentWindow) {
2693 auto oldParentItem =
d->parentItem;
2695 if (
d->parentItem) {
2697 alreadyAddedChild =
true;
2705 if (!oldParentItem &&
d->window) {
2710 d->refWindow(parentWindow);
2715 if (
d->parentItem && !alreadyAddedChild)
2717 else if (
d->window && !alreadyAddedChild)
2720 d->setEffectiveVisibleRecur(
d->calcEffectiveVisible());
2721 d->setEffectiveEnableRecur(
nullptr,
d->calcEffectiveEnable());
2723 if (
d->parentItem) {
2724 if (!scopeFocusedItem) {
2726 scopeFocusedItem =
this;
2728 scopeFocusedItem =
d->subFocusItem;
2731 if (scopeFocusedItem) {
2739 if (scopeFocusedItem !=
this)
2745 d->deliveryAgentPrivate()->
2756 d->resolveLayoutMirror();
2760 if (!
d->inDestructor)
2763 emit d->parentItem->visibleChildrenChanged();
2787 qWarning().nospace() <<
"QQuickItem::stackBefore: Cannot stack "
2788 <<
this <<
" before " << sibling <<
", which must be a sibling";
2797 Q_ASSERT(myIndex != -1 && siblingIndex != -1);
2799 if (myIndex == siblingIndex - 1)
2802 parentPrivate->
childItems.
move(myIndex, myIndex < siblingIndex ? siblingIndex - 1 : siblingIndex);
2807 for (
int ii =
qMin(siblingIndex, myIndex); ii < parentPrivate->
childItems.
size(); ++ii)
2832 qWarning().nospace() <<
"QQuickItem::stackAfter: Cannot stack "
2833 <<
this <<
" after " << sibling <<
", which must be a sibling";
2842 Q_ASSERT(myIndex != -1 && siblingIndex != -1);
2844 if (myIndex == siblingIndex + 1)
2847 parentPrivate->
childItems.
move(myIndex, myIndex > siblingIndex ? siblingIndex + 1 : siblingIndex);
2852 for (
int ii =
qMin(myIndex, siblingIndex + 1); ii < parentPrivate->
childItems.
size(); ++ii)
2875 return lhs->
z() < rhs->
z();
2913#if QT_CONFIG(cursor)
2929 emit q->childrenChanged();
2946#if QT_CONFIG(cursor)
2964 emit q->childrenChanged();
2983 qWarning(
"QQuickItem: Cannot use same item on different windows at the same time.");
3003 if (
extra.isAllocated() &&
extra->screenAttached)
3004 extra->screenAttached->windowChanged(
c);
3019 q->releaseResources();
3023 c->itemsToPolish.removeOne(
q);
3024#if QT_CONFIG(cursor)
3025 if (
c->cursorItem ==
q) {
3026 c->cursorItem =
nullptr;
3033 c->parentlessItems.remove(
q);
3039 if (
extra.isAllocated()) {
3040 extra->opacityNode =
nullptr;
3041 extra->clipNode =
nullptr;
3042 extra->rootNode =
nullptr;
3054 if (
extra.isAllocated() &&
extra->screenAttached)
3055 extra->screenAttached->windowChanged(
nullptr);
3093 qreal x = this->x.valueBypassingBindings();
3094 qreal y = this->y.valueBypassingBindings();
3102 *
t =
m.toTransform();
3107 t->translate(tp.
x(), tp.
y());
3110 t->translate(-tp.
x(), -tp.
y());
3122 QPoint quickWidgetOffset;
3124 QPointF pos = (renderWindow ? renderWindow :
window)->mapToGlobal(quickWidgetOffset);
3136 QPoint quickWidgetOffset;
3138 QPointF pos = (renderWindow ? renderWindow :
window)->mapToGlobal(quickWidgetOffset);
3154 return d->componentComplete;
3161 , widthValidFlag(
false)
3162 , heightValidFlag(
false)
3163 , componentComplete(true)
3166 , hoverEnabled(
false)
3168 , antialiasing(
false)
3170 , activeFocus(
false)
3171 , notifiedFocus(
false)
3172 , notifiedActiveFocus(
false)
3173 , filtersChildMouseEvents(
false)
3174 , explicitVisible(true)
3175 , effectiveVisible(true)
3176 , explicitEnable(true)
3177 , effectiveEnable(true)
3178 , polishScheduled(
false)
3179 , inheritedLayoutMirror(
false)
3180 , effectiveLayoutMirror(
false)
3181 , isMirrorImplicit(true)
3182 , inheritMirrorFromParent(
false)
3183 , inheritMirrorFromItem(
false)
3184 , isAccessible(
false)
3187 , subtreeCursorEnabled(
false)
3188 , subtreeHoverEnabled(
false)
3189 , activeFocusOnTab(
false)
3190 , implicitAntialiasing(
false)
3191 , antialiasingValid(
false)
3193 , replayingPressEvent(
false)
3194 , touchEnabled(
false)
3195 , hasCursorHandler(
false)
3196 , maybeHasSubsceneDeliveryAgent(true)
3197 , subtreeTransformChangedEnabled(true)
3198 , inDestructor(
false)
3199 , dirtyAttributes(0)
3205 , sortedChildItems(&childItems)
3251 if (pointerHandler->parent() != that) {
3252 qCDebug(lcHandlerParent) <<
"reparenting handler" << pointerHandler <<
":" << pointerHandler->parent() <<
"->" << that;
3257 QQuickWindow *thisWindow = qmlobject_cast<QQuickWindow *>(
o);
3267 qCDebug(lcTransient) << thisWindow <<
"is transient for" << itemWindow;
3268 thisWindow->setTransientParent(itemWindow);
3333 if (
i < resourcesCount)
3371 return quickItemPrivate->
extra.isAllocated() ? quickItemPrivate->
extra->resourcesList.value(
index) : 0;
3378 if (!quickItemPrivate->
extra.value().resourcesList.contains(
object)) {
3379 quickItemPrivate->
extra.value().resourcesList.append(
object);
3388 return quickItemPrivate->
extra.isAllocated() ? quickItemPrivate->
extra->resourcesList.size() : 0;
3395 if (quickItemPrivate->
extra.isAllocated()) {
3396 for (
QObject *
object : std::as_const(quickItemPrivate->
extra->resourcesList)) {
3400 quickItemPrivate->
extra->resourcesList.clear();
3408 if (quickItemPrivate->
extra.isAllocated()) {
3425 return p->childItems.at(
index);
3434 if (
o->parentItem() == that)
3435 o->setParentItem(
nullptr);
3437 o->setParentItem(that);
3443 return p->childItems.size();
3450 while (!
p->childItems.isEmpty())
3451 p->childItems.at(0)->setParentItem(
nullptr);
3458 if (!
p->childItems.isEmpty())
3459 p->childItems.last()->setParentItem(
nullptr);
3468 if (
p->childItems.at(
c)->isVisible()) visibleCount++;
3471 return visibleCount;
3477 const qsizetype childCount =
p->childItems.size();
3483 if (
p->childItems.at(
i)->isVisible()) visibleCount++;
3484 if (visibleCount ==
index)
return p->childItems.at(
i);
3494 return p->transforms.size();
3505 if (!
d->items.isEmpty() && !
p->transforms.isEmpty() &&
p->transforms.contains(
this)) {
3506 p->transforms.removeOne(
this);
3507 p->transforms.append(
this);
3509 p->transforms.append(
this);
3510 d->items.append(
item);
3524 if (!
d->items.isEmpty() && !
p->transforms.isEmpty() &&
p->transforms.contains(
this)) {
3525 p->transforms.removeOne(
this);
3526 p->transforms.prepend(
this);
3528 p->transforms.prepend(
this);
3529 d->items.append(
item);
3549 if (idx < 0 || idx >=
p->transforms.size())
3552 return p->transforms.at(idx);
3560 for (
qsizetype ii = 0; ii <
p->transforms.size(); ++ii) {
3566 p->transforms.clear();
3573 if (
extra.isAllocated() &&
extra->resourcesList.contains(
object))
3574 extra->resourcesList.removeAll(
object);
3693 result.object = q_func();
3736 if (!
d->extra.isAllocated() || !
d->extra->contents) {
3738 if (
d->componentComplete)
3739 d->extra->contents->complete();
3741 return d->extra->contents->rectF();
3750 return d->childItems;
3837#if QT_CONFIG(accessibility)
3838 if (QAccessible::isActive()) {
3839 if (
QObject *acc = QQuickAccessibleAttached::findAccessible(
this)) {
3840 QAccessibleEvent ev(acc, QAccessible::LocationChanged);
3841 QAccessible::updateAccessibility(&ev);
3908QQuickItem::UpdatePaintNodeData::UpdatePaintNodeData()
3953#define PRINT_LISTENERS() \
3955 qDebug().nospace() << q_func() << " (" << this \
3956 << ") now has the following listeners:"; \
3957 for (const auto &listener : std::as_const(changeListeners)) { \
3958 const auto objectPrivate = dynamic_cast<QObjectPrivate*>(listener.listener); \
3959 qDebug().nospace() << "- " << listener << " (QObject: " << (objectPrivate ? objectPrivate->q_func() : nullptr) << ")"; \
3968 if (lcChangeListeners().isDebugEnabled())
3981 if (lcChangeListeners().isDebugEnabled())
3990 if (lcChangeListeners().isDebugEnabled())
4004 if (lcChangeListeners().isDebugEnabled())
4012 if (
types.noChange()) {
4020 if (lcChangeListeners().isDebugEnabled())
4074#if QT_CONFIG(accessibility)
4075 if (QAccessible::isActive()) {
4076 if (
QObject *acc = QQuickAccessibleAttached::findAccessible(
this)) {
4077 QAccessibleEvent ev(acc, QAccessible::Focus);
4078 QAccessible::updateAccessibility(&ev);
4172#if QT_CONFIG(wheelevent)
4180void QQuickItem::wheelEvent(QWheelEvent *
event)
4240#if QT_CONFIG(quick_draganddrop)
4253void QQuickItem::dragEnterEvent(QDragEnterEvent *
event)
4270void QQuickItem::dragMoveEvent(QDragMoveEvent *
event)
4287void QQuickItem::dragLeaveEvent(QDragLeaveEvent *
event)
4304void QQuickItem::dropEvent(QDropEvent *
event)
4359 v = (bool)(
flags() & ItemAcceptsInputMethod);
4372 if (
d->extra.isAllocated() &&
d->extra->keyHandler)
4373 v =
d->extra->keyHandler->inputMethodQuery(
query);
4376 if (
d->extra.isAllocated() &&
d->extra->enterKeyAttached)
4377 v =
d->extra->enterKeyAttached->type();
4384 rect = parpar->mapRectFromItem(par,
rect);
4386 rect =
rect.intersected(parpar->clipRect());
4471 return d->baselineOffset;
4477 if (
offset ==
d->baselineOffset)
4509 qWarning() <<
metaObject()->className() <<
": Update called for a item without content";
4527 if (!
d->polishScheduled) {
4528 d->polishScheduled =
true;
4531 bool maybeupdate =
p->itemsToPolish.isEmpty();
4532 p->itemsToPolish.append(
this);
4533 if (maybeupdate)
d->window->maybeUpdate();
4553void QQuickItem::ensurePolished()
4558#if QT_DEPRECATED_SINCE(6, 5)
4572 if (!
item->isNull()) {
4578 if (!(*itemObj) && !
item->isNull()) {
4579 qmlWarning(itemForWarning) << functionNameForWarning <<
" given argument \"" <<
item->toQStringNoThrow()
4580 <<
"\" which is neither null nor an Item";
4590 qmlWarning(itemForWarning) << functionNameForWarning <<
"given argument \"" << sv->toQStringNoThrow()
4591 <<
"\" which is neither a point nor a rect";
4601 }
else if (
v.canConvert<
QRectF>()) {
4609 qmlWarning(itemForWarning) << functionNameForWarning <<
"given argument \"" << sv->toQStringNoThrow()
4610 <<
"\" which is neither a point nor a rect";
4618 if (!vx->isNumber() || !vy->isNumber()) {
4623 *
x = vx->asDouble();
4624 *
y = vy->asDouble();
4629 if (!vw->isNumber() || !vh->isNumber()) {
4633 *
w = vw->asDouble();
4634 *
h = vh->asDouble();
4661#if QT_DEPRECATED_SINCE(6, 5)
4673 if (!unwrapMapFromToFromItemArgs(
args,
this,
QStringLiteral(
"mapFromItem()"), &itemObj, &
x, &
y, &
w, &
h, &isRect))
4680 args->setReturnValue(rv.asReturnedValue());
4719#if QT_DEPRECATED_SINCE(6, 5)
4731 if (!unwrapMapFromToFromItemArgs(
args,
this,
QStringLiteral(
"mapToItem()"), &itemObj, &
x, &
y, &
w, &
h, &isRect))
4738 args->setReturnValue(rv.asReturnedValue());
4754 qmlWarning(itemForWarning) << functionNameForWarning <<
"given argument \"" << sv->toQStringNoThrow()
4755 <<
"\" which is not a point";
4766 qmlWarning(itemForWarning) << functionNameForWarning <<
"given argument \"" << sv->toQStringNoThrow()
4767 <<
"\" which is not a point";
4775 if (!vx->isNumber() || !vy->isNumber()) {
4780 *
x = vx->asDouble();
4781 *
y = vy->asDouble();
4811 args->setReturnValue(rv.asReturnedValue());
4825#if QT_DEPRECATED_SINCE(6, 5)
4841 args->setReturnValue(rv.asReturnedValue());
4919 if (scope && !
d->activeFocus) {
4920 if (
auto da =
d->deliveryAgentPrivate())
4942QQuickItem *QQuickItem::nextItemInFocusChain(
bool forward)
4968 if (
child->isVisible() &&
child->contains(point))
5015void QQuickItem::dumpItemTree()
const
5026 qDebug().nospace().noquote() << indentStr <<
5027#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
5032 if (
extra.isAllocated()) {
5033 for (
const auto handler :
extra->pointerHandlers)
5034 qDebug().nospace().noquote() << indentStr << u
" \u26ee " << handler;
5038 itemPriv->dumpItemTree(indent + 1);
5047 result.object = q_func();
5078 result.object = q_func();
5264 d->componentComplete =
false;
5266 d->_stateGroup->classBegin();
5268 d->_anchors->classBegin();
5269#if QT_CONFIG(quick_shadereffect)
5270 if (
d->extra.isAllocated() &&
d->extra->layer)
5271 d->extra->layer->classBegin();
5283 d->componentComplete =
true;
5285 d->_stateGroup->componentComplete();
5287 d->_anchors->componentComplete();
5291 if (
d->extra.isAllocated()) {
5292#if QT_CONFIG(quick_shadereffect)
5293 if (
d->extra->layer)
5294 d->extra->layer->componentComplete();
5297 if (
d->extra->keyHandler)
5298 d->extra->keyHandler->componentComplete();
5300 if (
d->extra->contents)
5301 d->extra->contents->complete();
5304 if (
d->window &&
d->dirtyAttributes) {
5305 d->addToDirtyList();
5309#if QT_CONFIG(accessibility)
5310 if (
d->isAccessible &&
d->effectiveVisible) {
5311 QAccessibleEvent ev(
this, QAccessible::ObjectShow);
5312 QAccessible::updateAccessibility(&ev);
5374 bool childWantsIt =
false;
5382#if QT_CONFIG(quick_shadereffect)
5383 if (
q == transformedItem) {
5385 extra->layer->updateMatrix();
5389 const bool ret = childWantsIt || thisWantsIt;
5391 qCDebug(lcVP) <<
"turned off subtree transformChanged notification after checking all children of" <<
q;
5396 if (thisWantsIt &&
q->clip())
5423 qreal startRotation,
5424 qreal activeRotation)
5427 QVector3D xformOrigin(
q->transformOriginPoint());
5429 startMatrix.
translate(
float(startPos.
x()),
float(startPos.
y()));
5431 startMatrix.
scale(
float(startScale));
5432 startMatrix.
rotate(
float(startRotation), 0, 0, -1);
5435 const QVector3D centroidParentVector(centroidParentPos);
5438 mat.
rotate(
float(activeRotation), 0, 0, 1);
5439 mat.
scale(
float(activeScale));
5443 mat = mat * startMatrix;
5445 QPointF xformOriginPoint =
q->transformOriginPoint();
5447 pos -= xformOriginPoint;
5480 if (qmlobject_cast<QQuickRootItem *>(
p->q_ptr)) {
5488 if (
p->extra.isAllocated()) {
5489 if (
auto da =
p->extra->subsceneDeliveryAgent)
5496 qCDebug(lcPtr) <<
"detached root of" <<
q <<
"is not a QQuickRootItem and also does not have its own DeliveryAgent";
5524 if (
extra.isAllocated() &&
extra->subsceneDeliveryAgent)
5525 return extra->subsceneDeliveryAgent;
5527 qCDebug(lcPtr) <<
"created new" <<
extra->subsceneDeliveryAgent;
5531 return extra->subsceneDeliveryAgent;
5536 if (!
extra.isAllocated() || !
extra->keyHandler)
5543 extra->keyHandler->keyPressed(
e, post);
5545 extra->keyHandler->keyReleased(
e, post);
5547 return e->isAccepted();
5561 q->keyPressEvent(
e);
5563 q->keyReleaseEvent(
e);
5565 if (
e->isAccepted())
5573 (
q ==
q->window()->contentItem() ||
q->activeFocusOnTab())) {
5582 e->setAccepted(
true);
5593 if (
extra.isAllocated() &&
extra->keyHandler) {
5594 extra->keyHandler->inputMethodEvent(
e,
false);
5596 if (
e->isAccepted())
5602 q->inputMethodEvent(
e);
5604 if (
e->isAccepted())
5607 if (
extra.isAllocated() &&
extra->keyHandler) {
5610 extra->keyHandler->inputMethodEvent(
e,
true);
5617 if (
extra.isAllocated() &&
extra->keyHandler)
5618 extra->keyHandler->shortcutOverrideEvent(
event);
5628 if (handler->wantsEventPoint(
event, point))
5646 bool delivered =
false;
5647 if (
extra.isAllocated()) {
5649 bool avoidThisHandler =
false;
5651 qmlobject_cast<const QQuickHoverHandler *>(handler)) {
5652 avoidThisHandler =
true;
5653 }
else if (avoidGrabbers) {
5654 for (
auto &
p :
event->points()) {
5655 if (
event->exclusiveGrabber(
p) == handler ||
event->passiveGrabbers(
p).contains(handler)) {
5656 avoidThisHandler =
true;
5661 if (!avoidThisHandler &&
5663 handler->handlePointerEvent(
event);
5695void QQuickItem::updateInputMethod(Qt::InputMethodQueries queries)
5709 return QRectF(0, 0,
d->width,
d->height);
5744 qCDebug(lcVP) <<
this <<
"intersecting" <<
viewport << mappedViewportRect <<
ret <<
"->" << mappedViewportRect.intersected(
ret);
5745 return mappedViewportRect.intersected(
ret);
5814 if (origin ==
d->origin())
5817 d->extra.value().origin = origin;
5833 if (
d->extra.isAllocated() && !
d->extra->userTransformOriginPoint.isNull())
5834 return d->extra->userTransformOriginPoint;
5835 return d->computeTransformOrigin();
5844 if (
d->extra.value().userTransformOriginPoint == point)
5847 d->extra->userTransformOriginPoint = point;
6017 d->extra.value().z =
v;
6020 if (
d->parentItem) {
6027#if QT_CONFIG(quick_shadereffect)
6028 if (
d->extra.isAllocated() &&
d->extra->layer)
6029 d->extra->layer->updateZ();
6088 return d->rotation();
6094 if (
d->rotation() ==
r)
6097 d->extra.value().rotation =
r;
6194 if (
d->scale() ==
s)
6197 d->extra.value().scale =
s;
6317 return d->opacity();
6323 qreal o = qBound<qreal>(0, newOpacity, 1);
6324 if (
d->opacity() ==
o)
6327 d->extra.value().opacity =
o;
6403 return d->effectiveVisible;
6470 return d->effectiveEnable;
6476 if (
e ==
d->explicitEnable)
6479 d->explicitEnable =
e;
6485 d->setEffectiveEnableRecur(scope,
d->calcEffectiveEnable());
6514 agent->removeGrabber(
q,
true,
true,
true);
6516 bool childVisibilityChanged =
false;
6521#if QT_CONFIG(accessibility)
6523 QAccessibleEvent ev(
q,
effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide);
6524 QAccessible::updateAccessibility(&ev);
6528 emit q->visibleChanged();
6529 if (childVisibilityChanged)
6530 emit q->visibleChildrenChanged();
6582#if QT_CONFIG(accessibility)
6585 changedState.disabled =
true;
6586 changedState.focusable =
true;
6587 QAccessibleStateChangeEvent ev(
q, changedState);
6588 QAccessible::updateAccessibility(&ev);
6591 emit q->enabledChanged();
6596 return extra.isAllocated() &&
extra.value().transparentForPositioner;
6601 extra.value().transparentForPositioner = transparent;
6607#define DIRTY_TO_STRING(value) if (dirtyAttributes & value) { \
6608 if (!rv.isEmpty()) \
6609 rv.append(QLatin1Char('|')); \
6610 rv.append(QLatin1String(#value)); \
6665 p->dirtyItemList =
q;
6685 ++
extra.value().effectRefCount;
6686 if (
extra->effectRefCount == 1) {
6692 if (++
extra->hideRefCount == 1)
6703 extra.value().recursiveEffectRefCount += refs;
6717 --
extra->effectRefCount;
6718 if (
extra->effectRefCount == 0) {
6724 if (--
extra->hideRefCount == 0)
6736 if ((cull && ++
extra.value().hideRefCount == 1) || (!cull && --
extra.value().hideRefCount == 0))
6745 q->itemChange(change,
data);
6752 q->itemChange(change,
data);
6757 q->itemChange(change,
data);
6760 q->itemChange(change,
data);
6765 q->itemChange(change,
data);
6770 q->itemChange(change,
data);
6775 q->itemChange(change,
data);
6780 q->itemChange(change,
data);
6783 q->itemChange(change,
data);
6790 q->itemChange(change,
data);
6862 return d->activeFocusOnTab;
6872 qWarning(
"QQuickItem: Cannot set activeFocusOnTab to false once item is the active focus item.");
6904 return d->antialiasingValid ?
d->antialiasing :
d->implicitAntialiasing;
6911 if (!
d->antialiasingValid) {
6912 d->antialiasingValid =
true;
6913 d->antialiasing =
d->implicitAntialiasing;
6916 if (aa ==
d->antialiasing)
6919 d->antialiasing = aa;
6930 if (!
d->antialiasingValid)
6933 d->antialiasingValid =
false;
6935 if (
d->implicitAntialiasing !=
d->antialiasing)
6942 bool prev =
q->antialiasing();
6945 emit q->antialiasingChanged(
q->antialiasing());
6956 return (QQuickItem::Flags)
d->flags;
6979 if (!parPriv->subtreeTransformChangedEnabled)
6980 qCDebug(lcVP) <<
"turned on transformChanged notification for subtree of" << par;
6981 parPriv->subtreeTransformChangedEnabled =
true;
6998 qWarning(
"QQuickItem: Cannot set FocusScope once item has children and is in a window.");
6999 flags &= ~ItemIsFocusScope;
7001 qWarning(
"QQuickItem: Cannot unset FocusScope flag.");
7070 d->x.removeBindingUnlessInWrapper();
7082 const qreal y =
d->y,
w =
d->width,
h =
d->height;
7089 d->y.removeBindingUnlessInWrapper();
7103 const qreal x =
d->x,
w =
d->width,
h =
d->height;
7132 d->x.setValueBypassingBindings(
pos.x());
7133 d->y.setValueBypassingBindings(
pos.y());
7137 const qreal w =
d->width,
h =
d->height;
7168 d->width.removeBindingUnlessInWrapper();
7172 d->widthValidFlag =
true;
7173 const qreal oldWidth =
d->width;
7188 d->width.takeBinding();
7189 d->widthValidFlag =
false;
7197 emit q->implicitWidthChanged();
7210 return d->getImplicitWidth();
7303 bool changed =
w !=
d->implicitWidth;
7304 d->implicitWidth =
w;
7306 if (
d->width.valueBypassingBindings() ==
w ||
widthValid()) {
7308 d->implicitWidthChanged();
7309 if (
d->width.valueBypassingBindings() ==
w ||
widthValid())
7314 const qreal oldWidth =
d->width.valueBypassingBindings();
7315 Q_ASSERT(!
d->width.hasBinding() || QQmlPropertyBinding::isUndefined(
d->width.binding()));
7317 d->width.setValueBypassingBindings(
w);
7321 const qreal x =
d->x.valueBypassingBindings();
7322 const qreal y =
d->y.valueBypassingBindings();
7324 const qreal height =
d->height.valueBypassingBindings();
7328 d->implicitWidthChanged();
7354 return d->widthValid();
7374 d->height.removeBindingUnlessInWrapper();
7378 d->heightValidFlag =
true;
7379 const qreal oldHeight =
d->height;
7397 d->height.takeBinding();
7398 d->heightValidFlag =
false;
7406 emit q->implicitHeightChanged();
7417 return d->getImplicitHeight();
7428 bool changed =
h !=
d->implicitHeight;
7429 d->implicitHeight =
h;
7430 if (
d->height.valueBypassingBindings() ==
h ||
heightValid()) {
7432 d->implicitHeightChanged();
7433 if (
d->height.valueBypassingBindings() ==
h ||
heightValid())
7438 const qreal oldHeight =
d->height.valueBypassingBindings();
7439 Q_ASSERT(!
d->height.hasBinding() || QQmlPropertyBinding::isUndefined(
d->height.binding()));
7441 d->height.setValueBypassingBindings(
h);
7445 const qreal x =
d->x.valueBypassingBindings();
7446 const qreal y =
d->y.valueBypassingBindings();
7447 const qreal width =
d->width.valueBypassingBindings();
7448 const qreal height =
d->height.valueBypassingBindings();
7453 d->implicitHeightChanged();
7462 bool wChanged =
w !=
d->implicitWidth;
7463 bool hChanged =
h !=
d->implicitHeight;
7465 d->implicitWidth =
w;
7466 d->implicitHeight =
h;
7474 d->implicitWidthChanged();
7480 d->implicitHeightChanged();
7500 const qreal x =
d->x.valueBypassingBindings();
7501 const qreal y =
d->y.valueBypassingBindings();
7503 QRectF(
x,
y, oldWidth, oldHeight));
7505 if (!wDone && wChanged)
7506 d->implicitWidthChanged();
7507 if (!hDone && hChanged)
7508 d->implicitHeightChanged();
7517 return d->heightValid();
7531 return QSizeF(
d->width,
d->height);
7548 d->heightValidFlag =
true;
7549 d->widthValidFlag =
true;
7551 if (
d->width ==
size.width() &&
d->height ==
size.height())
7554 const qreal oldHeight =
d->height;
7555 const qreal oldWidth =
d->width;
7556 d->height.setValueBypassingBindings(
size.height());
7557 d->width.setValueBypassingBindings(
size.width());
7637 return d->activeFocus;
7745 bool notifyListeners =
false;
7746 if (
d->window ||
d->parentItem) {
7752 auto da =
d->deliveryAgentPrivate();
7755 da->setFocusInScope(scope,
this, reason);
7757 da->clearFocusInScope(scope,
this, reason);
7763 if (oldSubFocusItem) {
7766 changed << oldSubFocusItem;
7771 d->updateSubFocusItem(scope,
focus);
7775 notifyListeners =
true;
7786 changed << oldSubFocusItem;
7791 notifyListeners =
true;
7796 if (notifyListeners)
7820 return d->subFocusItem;
7836 while ((ancestor = ancestor->
parentItem())) {
7837 if (ancestor ==
this)
7857 return d->acceptedMouseButtons();
7874 buttons &=
~Qt::LeftButton;
7875 if (buttons ||
d->extra.isAllocated()) {
7876 d->extra.value().acceptedMouseButtonsWithoutHandlers = buttons;
7877 d->extra.value().acceptedMouseButtons =
d->extra->pointerHandlers.isEmpty() ? buttons :
Qt::AllButtons;
7895 return d->filtersChildMouseEvents;
7910 d->filtersChildMouseEvents =
filter;
7943 return d->hoverEnabled;
7976 return d->touchEnabled;
7995#if QT_CONFIG(cursor)
8051#if QT_CONFIG(cursor)
8067QCursor QQuickItem::cursor()
const
8070 return d->extra.isAllocated()
8089 d->extra.value().cursor =
cursor;
8099 if (!
d->hasCursor) {
8100 d->hasCursor =
true;
8106 updateCursorPos =
pos;
8109 d->setHasCursorInChild(
d->hasCursor ||
d->hasCursorHandler);
8110 if (!updateCursorPos.
isNull())
8120void QQuickItem::unsetCursor()
8123 qCDebug(lcHoverTrace) <<
"clearing cursor";
8126 d->hasCursor =
false;
8127 d->setHasCursorInChild(
d->hasCursorHandler);
8128 if (
d->extra.isAllocated())
8133 if (windowPrivate->cursorItem ==
this) {
8135 windowPrivate->updateCursor(
pos);
8152 bool hoverCursorSet =
false;
8154 bool activeCursorSet =
false;
8156 if (
const QQuickHoverHandler *hoverHandler = qobject_cast<const QQuickHoverHandler *>(handler)) {
8157 hoverCursorSet = hoverHandler->isCursorShapeExplicitlySet();
8158 hoverCursor = hoverHandler->cursorShape();
8159 }
else if (handler->
active()) {
8160 activeCursorSet = handler->isCursorShapeExplicitlySet();
8161 activeCursor = handler->cursorShape();
8163 if (activeCursorSet)
8164 return activeCursor;
8198 if (!
h->isCursorShapeExplicitlySet())
8205 if (!activeHandler && hoverHandler && hoverHandler->
isHovered()) {
8206 qCDebug(lcHoverTrace) << hoverHandler << hoverHandler->
acceptedDevices() <<
"wants to set cursor" << hoverHandler->cursorShape();
8209 if (mouseHandler && mouseHandler->cursorShape() != hoverHandler->cursorShape()) {
8210 qCDebug(lcHoverTrace) <<
"mouse cursor conflict:" << mouseHandler <<
"wants" << mouseHandler->cursorShape()
8211 <<
"but" << hoverHandler <<
"wants" << hoverHandler->cursorShape();
8213 mouseHandler = hoverHandler;
8216 if (nonMouseHandler && nonMouseHandler->cursorShape() != hoverHandler->cursorShape()) {
8217 qCDebug(lcHoverTrace) <<
"non-mouse cursor conflict:" << nonMouseHandler <<
"wants" << nonMouseHandler->cursorShape()
8218 <<
"but" << hoverHandler <<
"wants" << hoverHandler->cursorShape();
8220 nonMouseHandler = hoverHandler;
8223 if (!hoverHandler &&
h->active())
8226 if (activeHandler) {
8227 qCDebug(lcHoverTrace) <<
"active handler choosing cursor" << activeHandler << activeHandler->cursorShape();
8228 return activeHandler;
8234 if (nonMouseHandler) {
8236 const bool beforeTimeout =
8242 <<
"choosing cursor according to" << winner << winner->cursorShape();
8245 qCDebug(lcHoverTrace) <<
"non-mouse handler choosing cursor" << nonMouseHandler << nonMouseHandler->cursorShape();
8246 return nonMouseHandler;
8249 qCDebug(lcHoverTrace) <<
"mouse handler choosing cursor" << mouseHandler << mouseHandler->cursorShape();
8250 return mouseHandler;
8274 auto da =
d->deliveryAgentPrivate();
8276 auto eventInDelivery = da->eventInDelivery();
8277 if (!eventInDelivery) {
8278 qWarning() <<
"cannot grab mouse: no event is currently being delivered";
8281 auto epd = da->mousePointData();
8282 eventInDelivery->setExclusiveGrabber(epd->eventPoint,
this);
8301 auto da =
d->deliveryAgentPrivate();
8303 auto eventInDelivery = da->eventInDelivery();
8304 if (!eventInDelivery) {
8306 da->removeGrabber(
this);
8309 const auto &eventPoint = da->mousePointData()->eventPoint;
8310 if (eventInDelivery->exclusiveGrabber(eventPoint) ==
this)
8311 eventInDelivery->setExclusiveGrabber(eventPoint,
nullptr);
8322 return d->keepMouse;
8344 d->keepMouse = keep;
8359 auto event =
d->deliveryAgentPrivate()->eventInDelivery();
8361 qWarning() <<
"cannot grab: no event is currently being delivered";
8364 for (
auto pt :
event->points()) {
8365 if (
ids.contains(pt.id()))
8366 event->setExclusiveGrabber(pt,
this);
8379 d->deliveryAgentPrivate()->removeGrabber(
this,
false,
true);
8391 return d->keepTouch;
8414 d->keepTouch = keep;
8439 if (
d->extra.isAllocated() &&
d->extra->mask) {
8441 return quickMask->contains(point - quickMask->position());
8444 QMetaMethod maskContains =
d->extra->mask->metaObject()->method(
d->extra->maskContainsIndex);
8445 maskContains.
invoke(
d->extra->mask,
8454 return x >= 0 &&
y >= 0 &&
x <
d->width &&
y <
d->height;
8523 if (!
d->extra.isAllocated())
8525 return d->extra->mask.data();
8531 const bool extraDataExists =
d->extra.isAllocated();
8536 if (!extraDataExists && !
mask)
8539 if (extraDataExists &&
d->extra->mask ==
mask)
8549 if (!extraDataExists)
8553 if (methodIndex < 0) {
8554 qmlWarning(
this) <<
QStringLiteral(
"QQuickItem: Object set as mask does not have an invokable contains method, ignoring it.");
8557 d->extra->maskContainsIndex = methodIndex;
8559 d->extra->mask =
mask;
8565 emit containmentMaskChanged();
8600 return d->itemToWindowTransform().map(point);
8623 return d->windowToGlobalTransform().map(
mapToScene(point));
8659 return d->itemToWindowTransform().mapRect(
rect);
8692 return d->windowToItemTransform().map(point);
8721 QPointF scenePoint =
d->globalToWindowTransform().map(point);
8745 t *=
d->windowToItemTransform();
8746 return t.mapRect(
rect);
8761 return d->windowToItemTransform().mapRect(
rect);
8821 switch (ev->
type()) {
8826 for (
uint i = 0;
i < 32; ++
i) {
8863 d->deliverKeyEvent(
static_cast<QKeyEvent*
>(ev));
8866 d->deliverShortcutOverrideEvent(
static_cast<QKeyEvent*
>(ev));
8886#if QT_CONFIG(wheelevent)
8888 wheelEvent(
static_cast<QWheelEvent*
>(ev));
8891#if QT_CONFIG(quick_draganddrop)
8893 dragEnterEvent(
static_cast<QDragEnterEvent*
>(ev));
8896 dragLeaveEvent(
static_cast<QDragLeaveEvent*
>(ev));
8899 dragMoveEvent(
static_cast<QDragMoveEvent*
>(ev));
8902 dropEvent(
static_cast<QDropEvent*
>(ev));
8905#if QT_CONFIG(gestures)
8917 if (
d->providesPalette())
8918 d->setCurrentColorGroup();
8933#ifndef QT_NO_DEBUG_STREAM
8943 debug <<
"QQuickItem(nullptr)";
8949 debug <<
item->metaObject()->className() <<
'(' <<
static_cast<void *
>(
item);
8950 if (!
item->objectName().isEmpty())
8951 debug <<
", name=" <<
item->objectName();
8958 debug <<
" \U0001f5bc";
8977#if QT_CONFIG(quick_shadereffect)
8979 return d->extra.isAllocated() &&
d->extra->layer &&
d->extra->layer->effectSource() ?
8980 d->extra->layer->effectSource()->isTextureProvider() :
false;
8997#if QT_CONFIG(quick_shadereffect)
8999 return d->extra.isAllocated() &&
d->extra->layer &&
d->extra->layer->effectSource() ?
9000 d->extra->layer->effectSource()->textureProvider() :
nullptr;
9048#if QT_CONFIG(quick_shadereffect)
9053QQuickItemLayer *QQuickItemPrivate::layer()
const
9056 extra.value().layer =
new QQuickItemLayer(
const_cast<QQuickItem *
>(q_func()));
9058 extra->layer->classBegin();
9060 return extra->layer;
9085 QEventPoint::States eventStates;
9087 bool anyPressOrReleaseInside =
false;
9088 bool anyGrabber =
false;
9089 for (
auto &
p :
event->points()) {
9094 auto pointGrabber =
event->exclusiveGrabber(
p);
9095 bool isGrabber = (pointGrabber ==
q);
9096 if (!isGrabber && pointGrabber && isFiltering) {
9097 auto handlerGrabber = qmlobject_cast<QQuickPointerHandler *>(pointGrabber);
9098 if (handlerGrabber && handlerGrabber->parentItem() ==
q)
9105 const auto localPos =
q->mapFromScene(
p.scenePosition());
9106 bool isInside =
q->contains(localPos);
9107 bool hasAnotherGrabber = pointGrabber && pointGrabber !=
q;
9109 if (isFiltering && !pointGrabber) {
9110 auto pg =
event->passiveGrabbers(
p);
9111 if (!pg.isEmpty()) {
9115 auto handler = qmlobject_cast<QQuickPointerHandler *>(pg.first());
9122 bool grabberIsChild =
false;
9124 while (isFiltering &&
parent) {
9126 grabberIsChild =
true;
9132 bool filterRelevant = isFiltering && grabberIsChild;
9133 if (!(isGrabber || (isInside && (!hasAnotherGrabber || isFiltering)) || filterRelevant))
9136 anyPressOrReleaseInside =
true;
9138 eventStates |=
p.state();
9141 QMutableEventPoint::setPosition(pCopy, localPos);
9142 touchPoints.
append(std::move(pCopy));
9147 if (touchPoints.
isEmpty() || (!anyPressOrReleaseInside && !anyGrabber && !isFiltering)) {
9154 switch (eventStates) {
9168 ret.setTimestamp(
event->timestamp());
9175 return extra.isAllocated() && !
extra->pointerHandlers.isEmpty();
9183 if (
auto *hh = qmlobject_cast<QQuickHoverHandler *>(
h); hh && hh->enabled())
9195 auto &handlers =
extra.value().pointerHandlers;
9196 if (!handlers.contains(
h))
9197 handlers.prepend(
h);
9198 auto &
res =
extra.value().resourcesList;
9199 if (!
res.contains(
h)) {
9211 auto &handlers =
extra.value().pointerHandlers;
9212 handlers.removeOne(
h);
9213 auto &
res =
extra.value().resourcesList;
9216 if (handlers.isEmpty())
9217 extra.value().acceptedMouseButtons =
extra.value().acceptedMouseButtonsWithoutHandlers;
9220#if QT_CONFIG(quick_shadereffect)
9227 , m_componentComplete(true)
9239QQuickItemLayer::~QQuickItemLayer()
9241 delete m_effectSource;
9259void QQuickItemLayer::setEnabled(
bool e)
9264 if (m_componentComplete) {
9271 emit enabledChanged(
e);
9274void QQuickItemLayer::classBegin()
9278 m_componentComplete =
false;
9281void QQuickItemLayer::componentComplete()
9284 m_componentComplete =
true;
9289void QQuickItemLayer::activate()
9298 m_effectSource->stackAfter(m_item);
9301 m_effectSource->setSourceItem(m_item);
9302 m_effectSource->setHideSource(
true);
9303 m_effectSource->setSmooth(m_smooth);
9304 m_effectSource->setLive(m_live);
9305 m_effectSource->setTextureSize(m_size);
9306 m_effectSource->setSourceRect(m_sourceRect);
9307 m_effectSource->setMipmap(m_mipmap);
9308 m_effectSource->setWrapMode(m_wrapMode);
9309 m_effectSource->setFormat(m_format);
9310 m_effectSource->setTextureMirroring(m_textureMirroring);
9311 m_effectSource->setSamples(m_samples);
9313 if (m_effectComponent)
9316 m_effectSource->setVisible(m_item->isVisible() && !m_effect);
9327void QQuickItemLayer::deactivate()
9331 if (m_effectComponent)
9334 delete m_effectSource;
9335 m_effectSource =
nullptr;
9341void QQuickItemLayer::activateEffect()
9347 QObject *created = m_effectComponent->beginCreate(m_effectComponent->creationContext());
9350 qWarning(
"Item: layer.effect is not a QML Item.");
9351 m_effectComponent->completeCreate();
9358 m_effect->stackAfter(m_effectSource);
9360 m_effect->setVisible(m_item->isVisible());
9361 m_effect->setProperty(m_name, QVariant::fromValue<QObject *>(m_effectSource));
9363 m_effectComponent->completeCreate();
9366void QQuickItemLayer::deactivateEffect()
9392 bool updateNeeded =
false;
9393 if (m_effectSource && m_effectComponent) {
9395 updateNeeded =
true;
9400 if (m_effectSource && m_effectComponent) {
9402 updateNeeded =
true;
9410 m_effectSource->setVisible(m_item->isVisible() && !m_effect);
9428void QQuickItemLayer::setMipmap(
bool mipmap)
9430 if (mipmap == m_mipmap)
9435 m_effectSource->setMipmap(m_mipmap);
9437 emit mipmapChanged(mipmap);
9465 m_effectSource->setFormat(m_format);
9467 emit formatChanged(m_format);
9482void QQuickItemLayer::setSourceRect(
const QRectF &sourceRect)
9484 if (sourceRect == m_sourceRect)
9486 m_sourceRect = sourceRect;
9489 m_effectSource->setSourceRect(m_sourceRect);
9491 emit sourceRectChanged(sourceRect);
9506void QQuickItemLayer::setSmooth(
bool s)
9513 m_effectSource->setSmooth(m_smooth);
9515 emit smoothChanged(
s);
9530void QQuickItemLayer::setLive(
bool live)
9537 m_effectSource->setLive(m_live);
9539 emit liveChanged(live);
9555void QQuickItemLayer::setSize(
const QSize &
size)
9562 m_effectSource->setTextureSize(
size);
9587 if (
mode == m_wrapMode)
9592 m_effectSource->setWrapMode(m_wrapMode);
9614 if (mirroring == m_textureMirroring)
9616 m_textureMirroring = mirroring;
9619 m_effectSource->setTextureMirroring(m_textureMirroring);
9621 emit textureMirroringChanged(mirroring);
9649void QQuickItemLayer::setSamples(
int count)
9651 if (m_samples ==
count)
9657 m_effectSource->setSamples(m_samples);
9677 m_effect->setProperty(m_name,
QVariant());
9678 m_effect->setProperty(
name, QVariant::fromValue<QObject *>(m_effectSource));
9702 m_effectSource->setParentItem(
parent);
9704 m_effectSource->stackAfter(m_item);
9707 m_effect->setParentItem(
parent);
9709 m_effect->stackAfter(m_effectSource);
9713void QQuickItemLayer::itemSiblingOrderChanged(
QQuickItem *)
9715 m_effectSource->stackAfter(m_item);
9717 m_effect->stackAfter(m_effectSource);
9720void QQuickItemLayer::itemVisibilityChanged(
QQuickItem *)
9728void QQuickItemLayer::updateZ()
9730 if (!m_componentComplete || !m_enabled)
9735 l->
setZ(m_item->z());
9738void QQuickItemLayer::updateOpacity()
9746void QQuickItemLayer::updateGeometry()
9753 QRectF bounds = m_item->QQuickItem::boundingRect();
9758void QQuickItemLayer::updateMatrix()
9762 if (!m_componentComplete || !m_enabled)
9778:
z(0),
scale(1), rotation(0), opacity(1),
9785 effectRefCount(0), hideRefCount(0),
9786 recursiveEffectRefCount(0),
9789 transparentForPositioner(
false)
9794#if QT_CONFIG(accessibility)
9795QAccessible::Role QQuickItemPrivate::effectiveAccessibleRole()
const
9798 auto *attached = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(
q,
false);
9799 auto role = QAccessible::NoRole;
9800 if (
auto *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(attached))
9801 role = accessibleAttached->role();
9802 if (role == QAccessible::NoRole)
9803 role = accessibleRole();
9807QAccessible::Role QQuickItemPrivate::accessibleRole()
const
9809 return QAccessible::NoRole;
9836 QObjectWrapper::markObjects(that, markStack);
9847 debug.nospace() <<
"ChangeListener listener=" << listener.
listener <<
" types=" << listener.
types;
9857{
return mapRectFromItem(
item,
rect); }
9869{
return mapRectToItem(
item,
rect); }
9888#include <moc_qquickitem.cpp>
9890#include "moc_qquickitem_p.cpp"
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QCursor class provides a mouse cursor with an arbitrary shape.
Qt::CursorShape shape() const
Returns the cursor shape identifier.
The QEventPoint class provides information about a point in a QPointerEvent.
Type
This enum type defines the valid event types in Qt.
@ ApplicationPaletteChange
Type type() const
Returns the event type.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFocusEvent class contains event parameters for widget focus events.
QList< QGraphicsItem * > childItems() const
QGraphicsWidget * window() const
bool hasFocus() const
Returns true if this item is active, and it or its \l{focusProxy()}{focus proxy} has keyboard input f...
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system,...
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...
static struct QGuiApplicationPrivate::QLastCursorPosition lastCursorPosition
static QStyleHints * styleHints()
Returns the application's style hints.
static QInputMethod * inputMethod()
returns the input method.
The QKeyEvent class describes a key event.
qsizetype size() const noexcept
bool isEmpty() const noexcept
bool removeOne(const AT &t)
qsizetype length() const noexcept
const_reference at(qsizetype i) const noexcept
void move(qsizetype from, qsizetype to)
const T & constFirst() const noexcept
void append(parameter_type t)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
void rotate(float angle, const QVector3D &vector)
Multiples this matrix by another that rotates coordinates through angle degrees about vector.
void scale(const QVector3D &vector)
Multiplies this matrix by another that scales coordinates by the components of vector.
QPoint map(const QPoint &point) const
Maps point by multiplying this matrix by point.
void translate(const QVector3D &vector)
Multiplies this matrix by another that translates coordinates by the components of vector.
static Q_GUI_EXPORT void detach(QEventPoint &p)
static QObjectPrivate * get(QObject *o)
const QObjectList & children() const
Returns a list of child objects.
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
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
void setParent(QObject *parent)
Makes the object a child of parent.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QVariant property(const char *name) const
Returns the value of the object's name property.
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
\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.
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
A base class for pointer events.
The QQmlComponent class encapsulates a QML component definition.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
RemoveLastFunction removeLast
void updateHorizontalAnchors()
void clearItem(QQuickItem *)
static QQuickAnchorsPrivate * get(QQuickAnchors *o)
void updateVerticalAnchors()
~QQuickContents() override
QQuickContents(QQuickItem *item)
void calcGeometry(QQuickItem *changed=nullptr)
void itemChildRemoved(QQuickItem *, QQuickItem *) override
void itemChildAdded(QQuickItem *, QQuickItem *) override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override
void itemDestroyed(QQuickItem *item) override
void removeGrabber(QQuickItem *grabber, bool mouse=true, bool touch=true, bool cancel=false)
Ungrabs all touchpoint grabs and/or the mouse grab from the given item grabber.
@ DontChangeFocusProperty
static bool isMouseOrWheelEvent(const QPointerEvent *ev)
static void notifyFocusChangesRecur(QQuickItem **item, int remaining, Qt::FocusReason reason)
static QQuickDeliveryAgent * currentOrItemDeliveryAgent(const QQuickItem *item)
void setFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions={ })
Set the focus inside scope to be item.
void clearFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions={ })
QQuickEnterKeyAttached(QObject *parent=nullptr)
\qmltype EnterKey \instantiates QQuickEnterKeyAttached \inqmlmodule QtQuick
void setType(Qt::EnterKeyType type)
static QQuickEnterKeyAttached * qmlAttachedProperties(QObject *)
void setXChange(bool enabled)
bool horizontalChange() const
bool matches(QQuickGeometryChange other) const
bool heightChange() const
void setWidthChange(bool enabled)
void setHeightChange(bool enabled)
void setYChange(bool enabled)
bool verticalChange() const
virtual void itemParentChanged(QQuickItem *, QQuickItem *)
virtual void itemSiblingOrderChanged(QQuickItem *)
virtual void itemChildAdded(QQuickItem *, QQuickItem *)
virtual ~QQuickItemChangeListener()
virtual void itemRotationChanged(QQuickItem *)
virtual void itemEnabledChanged(QQuickItem *)
virtual void itemOpacityChanged(QQuickItem *)
virtual void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &)
virtual void itemImplicitWidthChanged(QQuickItem *)
virtual void itemChildRemoved(QQuickItem *, QQuickItem *)
virtual QQuickAnchorsPrivate * anchorPrivate()
virtual void itemDestroyed(QQuickItem *)
virtual void itemVisibilityChanged(QQuickItem *)
virtual void itemImplicitHeightChanged(QQuickItem *)
virtual void itemFocusChanged(QQuickItem *, Qt::FocusReason)
virtual void keyReleased(QKeyEvent *event, bool post)
virtual void componentComplete()
QQuickItemKeyFilter(QQuickItem *=nullptr)
virtual void shortcutOverrideEvent(QKeyEvent *event)
virtual void keyPressed(QKeyEvent *event, bool post)
virtual ~QQuickItemKeyFilter()
bool calcEffectiveVisible() const
QQuickItem ** prevDirtyItem
void updateOrRemoveGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types)
void updateOrAddGeometryChangeListener(QQuickItemChangeListener *listener, QQuickGeometryChange types)
QQuickAnchorLine verticalCenter() const
QTransform windowToItemTransform() const
Returns a transform that maps points from window space into item space.
static void data_clear(QQmlListProperty< QObject > *)
QQmlListProperty< QQuickTransition > transitions()
QLazilyAllocated< ExtraData, ExtraDataTags > extra
virtual void registerAsContainmentMask(QQuickItem *, bool)
static void children_removeLast(QQmlListProperty< QQuickItem > *)
void notifyChangeListeners(QQuickItemPrivate::ChangeTypes changeTypes, Fn &&function, Args &&...args)
QList< QQuickItem * > paintOrderChildItems() const
quint64 _q_createJSWrapper(QV4::ExecutionEngine *engine)
static QQuickItem * visibleChildren_at(QQmlListProperty< QQuickItem > *prop, qsizetype index)
quint32 subtreeCursorEnabled
void init(QQuickItem *parent)
QQuickDeliveryAgent * deliveryAgent()
virtual bool handlePointerEvent(QPointerEvent *, bool avoidGrabbers=false)
quint32 maybeHasSubsceneDeliveryAgent
virtual bool transformChanged(QQuickItem *transformedItem)
static QQuickItem * prevTabChildItem(const QQuickItem *item, int start)
quint32 effectiveLayoutMirror
~QQuickItemPrivate() override
QQuickAnchors * anchors() const
\qmlpropertygroup QtQuick::Item::anchors \qmlproperty AnchorLine QtQuick::Item::anchors....
QSGTransformNode * itemNodeInstance
bool hasPointerHandlers() const
static qsizetype children_count(QQmlListProperty< QQuickItem > *)
void setLayoutMirror(bool mirror)
quint32 subtreeHoverEnabled
QPointer< QQuickItem > subFocusItem
QString dirtyToString() const
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void removeChild(QQuickItem *)
static void children_clear(QQmlListProperty< QQuickItem > *)
static qsizetype transform_count(QQmlListProperty< QQuickTransform > *list)
QQmlListProperty< QObject > resources()
static qsizetype data_count(QQmlListProperty< QObject > *)
\qmlproperty list<QtObject> QtQuick::Item::data \qmldefault
@ ChildrenStackingChanged
void derefFromEffectItem(bool unhide)
static QQuickItem * children_at(QQmlListProperty< QQuickItem > *, qsizetype)
static qsizetype resources_count(QQmlListProperty< QObject > *)
QTransform itemToWindowTransform() const
Returns a transform that maps points from item space into window space.
quint32 inheritMirrorFromItem
void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &)
void itemToParentTransform(QTransform *) const
Modifies t with this item's local transform relative to its parent.
virtual void implicitHeightChanged()
static void data_removeLast(QQmlListProperty< QObject > *)
QList< QQuickItem * > * sortedChildItems
QQmlListProperty< QQuickItem > visibleChildren()
void siblingOrderChanged()
static QObject * resources_at(QQmlListProperty< QObject > *, qsizetype)
virtual void mirrorChange()
QQmlListProperty< QQuickState > states()
void updateOrAddItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
QQuickStateGroup * _stateGroup
QVector< QQuickItemPrivate::ChangeListener > changeListeners
@ LeftMouseButtonAccepted
void addChild(QQuickItem *)
bool calcEffectiveEnable() const
static QQuickTransform * transform_at(QQmlListProperty< QQuickTransform > *list, qsizetype)
void deliverKeyEvent(QKeyEvent *)
static void resources_removeLast(QQmlListProperty< QObject > *)
QQuickAnchorLine right() const
QQuickItem * nextDirtyItem
static QObject * data_at(QQmlListProperty< QObject > *, qsizetype)
void setTransparentForPositioner(bool trans)
bool filterKeyEvent(QKeyEvent *, bool post)
void setImplicitAntialiasing(bool antialiasing)
static QQuickItem * nextTabChildItem(const QQuickItem *item, int start)
QQuickAnchorLine bottom() const
static void children_append(QQmlListProperty< QQuickItem > *, QQuickItem *)
static qsizetype visibleChildren_count(QQmlListProperty< QQuickItem > *prop)
void localizedTouchEvent(const QTouchEvent *event, bool isFiltering, QMutableTouchEvent *localized)
virtual void dumpItemTree(int indent) const
virtual void removePointerHandler(QQuickPointerHandler *h)
quint32 inheritMirrorFromParent
void recursiveRefFromEffectItem(int refs)
quint32 subtreeTransformChangedEnabled
static bool focusNextPrev(QQuickItem *item, bool forward)
QQuickItemPrivate::focusNextPrev focuses the next/prev item in the tab-focus-chain.
void removeFromDirtyList()
void setEffectiveEnableRecur(QQuickItem *scope, bool)
QTransform windowToGlobalTransform() const
Returns a transform that maps points from window space into global space.
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
QList< QQuickTransform * > transforms
virtual qreal getImplicitWidth() const
static void resources_append(QQmlListProperty< QObject > *, QObject *)
static bool canAcceptTabFocus(QQuickItem *item)
void deliverShortcutOverrideEvent(QKeyEvent *)
void setHasCursorInChild(bool hasCursor)
QQuickItem::TransformOrigin origin() const
bool setEffectiveVisibleRecur(bool)
void refWindow(QQuickWindow *)
QQuickAnchorLine left() const
virtual void setVisible(bool visible)
QQuickAnchorLine top() const
quint32 componentComplete
void markSortedChildrenDirty(QQuickItem *child)
QQuickDeliveryAgentPrivate * deliveryAgentPrivate()
virtual void addPointerHandler(QQuickPointerHandler *h)
bool hasEnabledHoverHandlers() const
quint32 inheritedLayoutMirror
QQmlListProperty< QQuickItem > children()
void refFromEffectItem(bool hide)
QQuickDeliveryAgent * ensureSubsceneDeliveryAgent()
QQuickAnchorLine horizontalCenter() const
void setState(const QString &)
QTransform globalToWindowTransform() const
Returns a transform that maps points from global space into window space.
void updateSubFocusItem(QQuickItem *scope, bool focus)
Clears all sub focus items from scope.
QPointF computeTransformOrigin() const
quint32 implicitAntialiasing
void _q_resourceObjectDeleted(QObject *)
QQuickStateGroup * _states()
virtual qreal getImplicitHeight() const
bool anyPointerHandlerWants(const QPointerEvent *event, const QEventPoint &point) const
static QQuickItem * nextPrevItemInTabFocusChain(QQuickItem *item, bool forward)
QQmlListProperty< QObject > data()
static void data_append(QQmlListProperty< QObject > *, QObject *)
static void transform_clear(QQmlListProperty< QQuickTransform > *list)
virtual QSGTransformNode * createTransformNode()
static QQuickItemPrivate * get(QQuickItem *item)
void setHasHoverInChild(bool hasHover)
bool isTransparentForPositioner() const
static void transform_append(QQmlListProperty< QQuickTransform > *list, QQuickTransform *)
QPointF adjustedPosForTransform(const QPointF ¢roid, const QPointF &startPos, const QVector2D &activeTranslatation, qreal startScale, qreal activeScale, qreal startRotation, qreal activeRotation)
static void resources_clear(QQmlListProperty< QObject > *)
virtual void implicitWidthChanged()
void resolveLayoutMirror()
QList< QQuickItem * > childItems
void setImplicitLayoutMirror(bool mirror, bool inherit)
void emitChildrenRectChanged(const QRectF &rect)
QQuickAnchorLine baseline() const
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QPointF mapToScene(const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within the scene's coor...
QBindable< qreal > bindableWidth()
bool event(QEvent *) override
\reimp
void parentChanged(QQuickItem *)
virtual void focusOutEvent(QFocusEvent *)
This event handler can be reimplemented in a subclass to receive focus-out events for an item.
void setFiltersChildMouseEvents(bool filter)
Sets whether pointer events intended for this item's children should be filtered through this item.
virtual void mouseReleaseEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void baselineOffsetChanged(qreal)
virtual QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *)
Called on the render thread when it is time to sync the state of the item with the scene graph.
virtual void hoverEnterEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-enter events for an item.
Flags flags() const
Returns the item flags for this item.
void setKeepTouchGrab(bool)
Sets whether the touch points grabbed by this item should remain exclusively with this item.
void classBegin() override
\reimp Derived classes should call the base class method before adding their own action to perform at...
void setTransformOriginPoint(const QPointF &)
QRectF mapRectToItem(const QQuickItem *item, const QRectF &rect) const
Maps the given rect in this item's coordinate system to the equivalent rectangular area within item's...
QList< QQuickItem * > childItems() const
Returns the children of this item.
Q_INVOKABLE QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in item's coordinate system to the equivalent point within this item's coordinat...
void setAntialiasing(bool)
void setSize(const QSizeF &size)
bool acceptTouchEvents() const
Returns whether touch events are accepted by this item.
TransformOrigin
\variable QQuickItem::ItemChangeData::realValue The numeric value that has changed: \l {QQuickItem::o...
QQuickItem * viewportItem() const
If the \l ItemObservesViewport flag is set, returns the nearest parent with the \l ItemIsViewport fla...
virtual void mouseDoubleClickEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse double-click events for an ite...
Qt::MouseButtons acceptedMouseButtons() const
Returns the mouse buttons accepted by this item.
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...
void antialiasingChanged(bool)
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
bool isFocusScope() const
Returns true if this item is a focus scope, and false otherwise.
virtual void mouseUngrabEvent()
This event handler can be reimplemented in a subclass to be notified when a mouse ungrab event has oc...
virtual void keyPressEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key press events for an item.
Q_INVOKABLE QPointF mapToItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within item's coordinat...
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void setAcceptHoverEvents(bool enabled)
If enabled is true, this sets the item to accept hover events; otherwise, hover events are not accept...
QBindable< qreal > bindableY()
QPointF mapFromScene(const QPointF &point) const
Maps the given point in the scene's coordinate system to the equivalent point within this item's coor...
QString state() const
\qmlproperty string QtQuick::Item::state
virtual void hoverMoveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-move events for an item.
void setState(const QString &)
qreal y
Defines the item's y position relative to its parent.
bool activeFocusOnTab() const
\qmlproperty bool QtQuick::Item::activeFocusOnTab
bool hasActiveFocus() const
void setAcceptTouchEvents(bool accept)
If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accept...
qreal baselineOffset() const
\qmlproperty int QtQuick::Item::baselineOffset
Q_INVOKABLE QQuickItem * childAt(qreal x, qreal y) const
\qmlmethod QtQuick::Item::childAt(real x, real y)
TransformOrigin transformOrigin
\qmlproperty enumeration QtQuick::Item::transformOrigin This property holds the origin point around w...
virtual QSGTextureProvider * textureProvider() const
Returns the texture provider for an item.
QRectF childrenRect()
\qmlpropertygroup QtQuick::Item::childrenRect \qmlproperty real QtQuick::Item::childrenRect....
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
QObject * containmentMask
\qmlproperty QObject* QtQuick::Item::containmentMask
virtual QRectF boundingRect() const
Returns the extents of the item in its own coordinate system: a rectangle from {0,...
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
bool keepTouchGrab() const
Returns whether the touch points grabbed by this item should exclusively remain with this item.
void setFlags(Flags flags)
Enables the specified flags for this item.
QQuickWindow * window() const
Returns the window in which this item is rendered.
void setContainmentMask(QObject *mask)
virtual void mousePressEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
~QQuickItem() override
Destroys the QQuickItem.
void setBaselineOffset(qreal)
bool acceptHoverEvents() const
Returns whether hover events are accepted by this item.
qreal width
This property holds the width of this item.
QQuickItem * scopedFocusItem() const
If this item is a focus scope, this returns the item in its focus chain that currently has focus.
QQuickItem * parentItem() const
bool filtersChildMouseEvents() const
Returns whether pointer events intended for this item's children should be filtered through this item...
QRectF mapRectFromItem(const QQuickItem *item, const QRectF &rect) const
Maps the given rect in item's coordinate system to the equivalent rectangular area within this item's...
void stackAfter(const QQuickItem *)
Moves the specified sibling item to the index after this item within the list of children.
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
QTransform itemTransform(QQuickItem *, bool *) const
\qmlmethod point QtQuick::Item::mapFromItem(Item item, real x, real y) \qmlmethod point QtQuick::Item...
virtual void touchUngrabEvent()
This event handler can be reimplemented in a subclass to be notified when a touch ungrab event has oc...
void grabTouchPoints(const QList< int > &ids)
bool clip() const
\qmlproperty bool QtQuick::Item::clip This property holds whether clipping is enabled.
QBindable< qreal > bindableHeight()
void setImplicitHeight(qreal)
bool keepMouseGrab() const
Returns whether mouse input should exclusively remain with this item.
bool heightValid() const
Returns whether the height property has been set explicitly.
void setKeepMouseGrab(bool)
Sets whether the mouse input should remain exclusively with this item.
Q_INVOKABLE void forceActiveFocus()
\qmlmethod point QtQuick::Item::mapToItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::...
bool antialiasing
\qmlproperty bool QtQuick::Item::antialiasing
bool smooth
\qmlproperty bool QtQuick::Item::smooth
qreal rotation
\qmlproperty real QtQuick::Item::rotation This property holds the rotation of the item in degrees clo...
bool widthValid() const
Returns whether the width property has been set explicitly.
virtual void touchEvent(QTouchEvent *event)
This event handler can be reimplemented in a subclass to receive touch events for an item.
qreal height
This property holds the height of this item.
virtual bool childMouseEventFilter(QQuickItem *, QEvent *)
Reimplement this method to filter the pointer events that are received by this item's children.
virtual void updatePolish()
This function should perform any layout as required for this item.
void setPosition(const QPointF &)
virtual void releaseResources()
This function is called when an item should release graphics resources which are not already managed ...
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler can be reimplemented in a subclass to receive key release events for an item.
QQuickItem(QQuickItem *parent=nullptr)
Constructs a QQuickItem with the given parent.
QRectF mapRectToScene(const QRectF &rect) const
Maps the given rect in this item's coordinate system to the equivalent rectangular area within the sc...
virtual QRectF clipRect() const
Returns the rectangular area within this item that is currently visible in \l viewportItem(),...
qreal scale
\qmlproperty real QtQuick::Item::scale This property holds the scale factor for this item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
@ ItemActiveFocusHasChanged
@ ItemAntialiasingHasChanged
@ ItemDevicePixelRatioHasChanged
virtual void focusInEvent(QFocusEvent *)
This event handler can be reimplemented in a subclass to receive focus-in events for an item.
void setTransformOrigin(TransformOrigin)
void visibleChildrenChanged()
qreal opacity
\qmlproperty real QtQuick::Item::opacity
bool isUnderMouse() const
QRectF mapRectFromScene(const QRectF &rect) const
Maps the given rect in the scene's coordinate system to the equivalent rectangular area within this i...
@ ItemClipsChildrenToShape
bool enabled
\qmlproperty bool QtQuick::Item::enabled
bool isAncestorOf(const QQuickItem *child) const
Returns true if this item is an ancestor of child (i.e., if this item is child's parent,...
QBindable< qreal > bindableX()
void transformOriginChanged(TransformOrigin)
void setImplicitWidth(qreal)
virtual void hoverLeaveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void update()
Schedules a call to updatePaintNode() for this item.
void stackBefore(const QQuickItem *)
Moves the specified sibling item to the index before this item within the list of children.
QQmlListProperty< QQuickTransform > transform
\qmlproperty list<Transform> QtQuick::Item::transform This property holds the list of transformations...
void polish()
Schedules a polish event for this item.
virtual bool isTextureProvider() const
Returns true if this item is a texture provider.
virtual void mouseMoveEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
void setActiveFocusOnTab(bool)
void setImplicitSize(qreal, qreal)
QPointF transformOriginPoint
void setAccepted(bool accepted)
void reset(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1)
void setLeft(QQuickItem *)
static QQuickKeyNavigationAttached * qmlAttachedProperties(QObject *)
void setTab(QQuickItem *)
void setPriority(Priority)
QQuickKeyNavigationAttached(QObject *=nullptr)
\qmltype KeyNavigation \instantiates QQuickKeyNavigationAttached \inqmlmodule QtQuick
void setBacktab(QQuickItem *)
void keyReleased(QKeyEvent *event, bool post) override
void keyPressed(QKeyEvent *event, bool post) override
void setRight(QQuickItem *)
void setDown(QQuickItem *)
~QQuickKeysAttached() override
void keyPressed(QKeyEvent *event, bool post) override
static QQuickKeysAttached * qmlAttachedProperties(QObject *)
void keyReleased(QKeyEvent *event, bool post) override
QQuickKeysAttached(QObject *parent=nullptr)
\qmltype Keys \instantiates QQuickKeysAttached \inqmlmodule QtQuick
void released(QQuickKeyEvent *event)
void setPriority(Priority)
void pressed(QQuickKeyEvent *event)
void shortcutOverride(QQuickKeyEvent *event)
void shortcutOverrideEvent(QKeyEvent *event) override
void componentComplete() override
void setChildrenInherit(bool)
void childrenInheritChanged()
static QQuickLayoutMirroringAttached * qmlAttachedProperties(QObject *)
QQuickLayoutMirroringAttached(QObject *parent=nullptr)
\qmltype LayoutMirroring \instantiates QQuickLayoutMirroringAttached \inqmlmodule QtQuick
QInputDevice::DeviceTypes acceptedDevices
static QQuickPointerHandlerPrivate * get(QQuickPointerHandler *q)
static QVector< QObject * > & deviceDeliveryTargets(const QInputDevice *device)
QQuickItem * parentItem() const
\qmlproperty Item QtQuick::PointerHandler::parent
static QWindow * renderWindowFor(QQuickWindow *win, QPoint *offset=nullptr)
Returns the real window that win is being rendered to, if any.
QQmlListProperty< QQuickTransition > transitionsProperty()
\qmlproperty list<Transition> QtQuick::StateGroup::transitions This property holds a list of transiti...
void setState(const QString &)
QQmlListProperty< QQuickState > statesProperty()
\qmlproperty list<State> QtQuick::StateGroup::states This property holds a list of states defined by ...
void classBegin() override
Invoked after class creation, but before any properties have been set.
void dirtyItem(QQuickItem *)
static QQuickWindowPrivate * get(QQuickWindow *c)
QVector< QQuickItem * > itemsToPolish
QSet< QQuickItem * > parentlessItems
QQuickDeliveryAgent * deliveryAgent
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setY(qreal pos) noexcept
Sets the top edge of the rectangle to the given finite y coordinate.
constexpr void setWidth(qreal w) noexcept
Sets the width of the rectangle to the given finite width.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr void setHeight(qreal h) noexcept
Sets the height of the rectangle to the given finite height.
constexpr void setX(qreal pos) noexcept
Sets the left edge of the rectangle to the given finite x coordinate.
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
The QSGTextureProvider class encapsulates texture based entities in QML.
bool remove(const T &value)
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Qt::TabFocusBehavior tabFocusBehavior
The focus behavior on press of the tab key.
The QTouchEvent class contains parameters that describe a touch event.
constexpr size_type size() const noexcept
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
The QVector2D class represents a vector or vertex in 2D space.
The QVector3D class represents a vector or vertex in 3D space.
[Window class with invokable method]
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
static void formatQRect(QDebug &debug, const Rect &rect)
@ ImInputItemClipRectangle
#define QByteArrayLiteral(str)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyIsNull(qfloat16 f) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
static Q_DECL_CONST_FUNCTION bool qt_is_nan(double d)
#define Q_RETURN_ARG(Type, data)
#define Q_ARG(Type, data)
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint * ids
GLsizei GLenum GLenum * types
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble q
GLfixed GLfixed GLint GLint order
GLenum GLenum GLenum GLenum GLenum scale
static qreal component(const QPointF &point, unsigned int i)
#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Disconnect Signal of Sender from Method of Receiver.
#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Connect Signal of Sender to Method of Receiver.
T qmlobject_cast(QObject *object)
This method is identical to qobject_cast<T>() except that it does not require lazy QMetaObjects to be...
QQuickItem * qmlobject_cast< QQuickItem * >(QObject *object)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define PRINT_LISTENERS()
QDebug operator<<(QDebug debug, const QQuickItem *item)
static bool itemZOrder_sort(QQuickItem *lhs, QQuickItem *rhs)
#define DIRTY_TO_STRING(value)
void debugFocusTree(QQuickItem *item, QQuickItem *scope=nullptr, int depth=1)
static QT_BEGIN_NAMESPACE const quint64 kCursorOverrideTimeout
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
#define QStringLiteral(str)
#define QT_CONFIG(feature)
#define QT_VERSION_CHECK(major, minor, patch)
unsigned long long quint64
#define DEFINE_OBJECT_VTABLE(classname)
#define V4_OBJECT2(DataClass, superClass)
bool testFlag(MaskType mask, FlagType flag)
if(qFloatDistance(a, b)<(1<< 7))
[0]
obj metaObject() -> className()
rect sceneTransform().map(QPointF(0
view viewport() -> scroll(dx, dy, deviceRect)
\inmodule QtCore \reentrant
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept
qsizetype lastIndexOf(const AT &t, qsizetype from=-1) const noexcept
QQuickItemChangeListener * listener
QQuickGeometryChange gTypes
QV4::ReturnedValue fromVariant(const QVariant &)
ReturnedValue throwTypeError()
static void markObjects(QV4::Heap::Base *that, QV4::MarkStack *markStack)
static void markWrapper(QObject *object, MarkStack *markStack)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent