9#include <QtGui/qstylehints.h>
10#include <QtGui/private/qguiapplication_p.h>
11#include <QtQml/qqmlinfo.h>
12#include <QtQuick/private/qquickwindow_p.h>
13#include <QtQuick/private/qquickanimation_p.h>
14#include <QtQuick/private/qquicktransition_p.h>
15#include <QtQuickTemplates2/private/qquickoverlay_p.h>
174 return point.
y() /
size.height();
178 return point.
x() /
size.width();
212 switch (drawer->edge()) {
247 QRectF geometry(0, 0, overlay ? overlay->
width() : 0, overlay ? overlay->
height() : 0);
266 return pos.x() <=
q->dragMargin();
268 return pos.x() >=
q->window()->width() -
q->dragMargin();
270 return pos.y() <=
q->dragMargin();
272 return pos.y() >=
q->window()->height() -
q->dragMargin();
286 switch (
event->type()) {
292 mouseEvent->addPassiveGrabber(mouseEvent->point(0),
popupItem);
298#if QT_CONFIG(quicktemplates2_multitouch)
305 touchEvent->addPassiveGrabber(point,
popupItem);
323 return item->keepMouseGrab() ||
item->keepTouchGrab();
334 const QPointF movePoint =
event->scenePosition();
340 bool overThreshold =
false;
346 overThreshold = xOverThreshold && !yOverThreshold;
348 overThreshold = yOverThreshold && !xOverThreshold;
371 return overThreshold;
374#if QT_CONFIG(quicktemplates2_multitouch)
378 bool handled = handleTouchEvent(
item,
event);
383 bool overThreshold =
false;
388 const QPointF movePoint = point.scenePosition();
399 overThreshold = xOverThreshold && !yOverThreshold;
401 overThreshold = yOverThreshold && !xOverThreshold;
418 event->setExclusiveGrabber(point,
popupItem);
424 return overThreshold;
519 velocity = -velocity;
567 QList<QQuickStateAction> actions;
574 QQmlListProperty<QQuickAbstractAnimation> animations = transition->
animations();
575 int count = animations.count(&animations);
618 qmlWarning(
q) <<
"invalid edge value - valid values are: "
619 <<
"Qt.TopEdge, Qt.LeftEdge, Qt.RightEdge, Qt.BottomEdge";
636 setFiltersChildMouseEvents(
true);
637 setClosePolicy(CloseOnEscape | CloseOnReleaseOutside);
659 auto realEdge =
edge;
661 const bool clockwise = rotation > 0;
662 while (
qAbs(rotation) >= 90) {
663 rotation -= clockwise ? 90 : -90;
688 if (!
d->setEdge(
edge))
738 return d->dragMargin;
747 d->dragMargin = margin;
770 return d->interactive;
781 emit interactiveChanged();
787 switch (
event->type()) {
788#if QT_CONFIG(quicktemplates2_multitouch)
809 d->grabMouse(
d->popupItem,
event);
815 switch (
event->type()) {
816#if QT_CONFIG(quicktemplates2_multitouch)
828#if QT_CONFIG(quicktemplates2_multitouch)
832 d->grabTouch(
d->popupItem,
event);
845#include "moc_qquickdrawer_p.cpp"
The QEventPoint class provides information about a point in a QPointerEvent.
static QStyleHints * styleHints()
Returns the application's style hints.
\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...
The QQmlProperty class abstracts accessing properties on objects created from QML.
void setDefaultTarget(const QQmlProperty &)
Side panel that can be opened and closed using a swipe gesture.
void reposition() override
QQuickDrawerPositioner(QQuickDrawer *drawer)
void showDimmer() override
void handleUngrab() override
bool prepareEnterTransition() override
bool handlePress(QQuickItem *item, const QPointF &point, ulong timestamp) override
bool delayedEnterTransition
void resizeDimmer() override
bool setEdge(Qt::Edge edge)
bool isWithinDragMargin(const QPointF &point) const
qreal positionAt(const QPointF &point) const
QQuickPopupPositioner * getPositioner() override
bool grabMouse(QQuickItem *item, QMouseEvent *event)
bool handleRelease(QQuickItem *item, const QPointF &point, ulong timestamp) override
bool startDrag(QEvent *event)
qreal offsetAt(const QPointF &point) const
Qt::Edge effectiveEdge() const
bool blockInput(QQuickItem *item, const QPointF &point) const override
void hideDimmer() override
bool handleMove(QQuickItem *item, const QPointF &point, ulong timestamp) override
bool prepareExitTransition() override
QQuickVelocityCalculator velocityCalculator
void setEdge(Qt::Edge edge)
void setPosition(qreal position)
void setDragMargin(qreal margin)
bool overlayEvent(QQuickItem *item, QEvent *event) override
QQuickDrawer(QObject *parent=nullptr)
bool childMouseEventFilter(QQuickItem *child, QEvent *event) override
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setInteractive(bool interactive)
bool isInteractive() const
void mouseMoveEvent(QMouseEvent *event) override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setKeepTouchGrab(bool)
Sets whether the touch points grabbed by this item should remain exclusively with this item.
void setSize(const QSizeF &size)
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
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...
qreal y
Defines the item's y position relative to its parent.
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
bool keepTouchGrab() const
Returns whether the touch points grabbed by this item should exclusively remain with this item.
qreal width
This property holds the width of this item.
bool keepMouseGrab() const
Returns whether mouse input should exclusively remain with this item.
void setKeepMouseGrab(bool)
Sets whether the mouse input should remain exclusively with this item.
qreal rotation
\qmlproperty real QtQuick::Item::rotation This property holds the rotation of the item in degrees clo...
qreal height
This property holds the height of this item.
void setPosition(const QPointF &)
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,...
static QQuickOverlay * overlay(QQuickWindow *window)
QQmlListProperty< QQuickAbstractAnimation > animations
\qmlproperty list<Animation> QtQuick::Transition::animations \qmldefault
void startMeasuring(const QPointF &point1, qint64 timestamp=0)
void stopMeasuring(const QPointF &m_point2, qint64 timestamp=0)
static bool dragOverThreshold(qreal d, Qt::Axis axis, const QEventPoint *tp, int startDragThreshold=-1)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
QQuickItem * contentItem
\qmlattachedproperty Item Window::contentItem
\inmodule QtCore\reentrant
constexpr void setY(qreal pos) noexcept
Sets the top edge of the rectangle to the given finite y coordinate.
QMap< int, QEventPoint > points
The QTouchEvent class contains parameters that describe a touch event.
int width
the width of the window's geometry
int height
the height of the window's geometry
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
void qmlExecuteDeferred(QObject *object)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static const qreal openCloseVelocityThreshold
static bool keepGrab(QQuickItem *item)
static QList< QQuickStateAction > prepareTransition(QQuickDrawer *drawer, QQuickTransition *transition, qreal to)
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
QLatin1StringView QLatin1String