12#include <QtQml/qqmlinfo.h>
13#include <QtQml/qqmlproperty.h>
14#include <QtQml/qqmlcomponent.h>
47 QQuickPopup *popup = qobject_cast<QQuickPopup *>((*it)->parent());
59 return one->z() > another->z();
88 QQuickDrawer *drawer = qobject_cast<QQuickDrawer *>(popup);
110 switch (
event->type()) {
114#if QT_CONFIG(quicktemplates2_multitouch)
164 switch (
event->type()) {
181 switch (
event->type()) {
195#if QT_CONFIG(quicktemplates2_multitouch)
198 bool handled =
false;
199 switch (
event->type()) {
204 switch (point.state()) {
235 if (
QQuickDrawer *drawer = qobject_cast<QQuickDrawer *>(popup)) {
251 if (popup && !popup->isVisible())
299#if QT_CONFIG(quicktemplates2_multitouch)
359 const char *
name =
"_q_QQuickOverlay";
365 if (content && content->
window()) {
385 if (
data.item->parent() ==
d->mouseGrabberPopup)
386 d->setMouseGrabberPopup(
nullptr);
401 d->handleMouseEvent(
this,
event);
407 d->handleMouseEvent(
this,
event);
413 d->handleMouseEvent(
this,
event);
416#if QT_CONFIG(quicktemplates2_multitouch)
420 d->handleTouchEvent(
this,
event);
424#if QT_CONFIG(wheelevent)
425void QQuickOverlay::wheelEvent(QWheelEvent *
event)
428 if (
d->mouseGrabberPopup) {
429 d->mouseGrabberPopup->overlayEvent(
this,
event);
432 const auto popups =
d->stackingOrderPopups();
434 if (popup->overlayEvent(
this,
event))
445 const auto popups =
d->stackingOrderPopups();
458 bool handled =
false;
459 switch (
event->type()) {
460#if QT_CONFIG(quicktemplates2_multitouch)
495 switch (
event->type()) {
496#if QT_CONFIG(quicktemplates2_multitouch)
506 if (!
d->mouseGrabberPopup) {
509 if (
d->handleRelease(
d->window->contentItem(),
event,
nullptr))
535#if QT_CONFIG(quicktemplates2_multitouch)
554#if QT_CONFIG(quicktemplates2_multitouch)
561 if (!
d->mouseGrabberPopup)
562 d->handleRelease(
d->window->contentItem(),
event,
nullptr);
565#if QT_CONFIG(wheelevent)
570 QWheelEvent *we =
static_cast<QWheelEvent *
>(
event);
572 d->window->contentItem(), we, we->point(0),
false,
false);
577 const auto popups =
d->stackingOrderPopups();
580 for (
const auto &popup : popups) {
581 const QQuickItem *popupItem = popup->popupItem();
588 if (popup->overlayEvent(topItem, we))
631 emit q->overlayChanged();
662 d->setWindow(popup->window());
665 d->setWindow(qobject_cast<QQuickWindow *>(
parent));
750#include "moc_qquickoverlay_p.cpp"
The QEventPoint class provides information about a point in a QPointerEvent.
QGraphicsWidget * window() const
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
bool isAncestorOf(const QGraphicsItem *child) const
Returns true if this item is an ancestor of child (i.e., if this item is child's parent,...
bool isEmpty() const noexcept
bool removeOne(const AT &t)
void reserve(qsizetype size)
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
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
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 setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
\inmodule QtCore\reentrant
A base class for pointer events.
The QQmlComponent class encapsulates a QML component definition.
static QQuickDeliveryAgent * currentEventDeliveryAgent
static QQuickDrawerPrivate * get(QQuickDrawer *drawer)
QList< QQuickItem * > paintOrderChildItems() const
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
QQmlListProperty< QQuickItem > children()
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFiltersChildMouseEvents(bool filter)
Sets whether pointer events intended for this item's children should be filtered through this item.
QList< QQuickItem * > childItems() const
Returns the children of this item.
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
void setAcceptTouchEvents(bool accept)
If enabled is true, this sets the item to accept touch events; otherwise, touch events are not accept...
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
QQuickWindow * window() const
Returns the window in which this item is rendered.
QQuickItem * parentItem() const
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
virtual void touchEvent(QTouchEvent *event)
This event handler can be reimplemented in a subclass to receive touch events for an item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
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,...
void setWindow(QQuickWindow *newWindow)
void setModal(QQmlComponent *modal)
void setModeless(QQmlComponent *modeless)
QQuickOverlayAttached(QObject *parent=nullptr)
\qmlattachedsignal QtQuick.Controls::Overlay::pressed()
QList< QQuickPopup * > stackingOrderPopups() const
A window overlay for popups.
QList< QQuickPopup * > stackingOrderDrawers() const
void setMouseGrabberPopup(QQuickPopup *popup)
QList< QQuickPopup * > allDrawers
bool startDrag(QEvent *event, const QPointF &pos)
QPointer< QQuickPopup > mouseGrabberPopup
QList< QQuickPopup * > allPopups
bool handleMouseEvent(QQuickItem *source, QMouseEvent *event, QQuickPopup *target=nullptr)
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void removePopup(QQuickPopup *popup)
bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target)
bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target)
void addPopup(QQuickPopup *popup)
bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target)
bool handleHoverEvent(QQuickItem *source, QHoverEvent *event, QQuickPopup *target=nullptr)
static QQuickOverlay * overlay(QQuickWindow *window)
void setModal(QQmlComponent *modal)
void mouseMoveEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse move events for an item.
static QQuickOverlayAttached * qmlAttachedProperties(QObject *object)
void mouseReleaseEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void setModeless(QQmlComponent *modeless)
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override
Reimplement this method to filter the pointer events that are received by this item's children.
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QQuickOverlay(QQuickItem *parent=nullptr)
void itemChange(ItemChange change, const ItemChangeData &data) override
Called when change occurs for this item.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
static QQuickWindowPrivate * get(QQuickWindow *c)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
QQuickItem * contentItem
\qmlattachedproperty Item Window::contentItem
\inmodule QtCore\reentrant
The QTouchEvent class contains parameters that describe a touch event.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
void contentOrientationChanged(Qt::ScreenOrientation orientation)
Qt::ScreenOrientation contentOrientation
the orientation of the window's contents
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ MouseEventNotSynthesized
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent