7#include <QtQml/qqmlinfo.h>
8#include <QtQuick/private/qquickdraghandler_p.h>
9#include <QtQuick/private/qquickhoverhandler_p.h>
11#include <QtQuick/private/qquicktableview_p_p.h>
342 emit q_func()->draggingChanged();
346 attached->setDragging(dragging);
356 if (
const auto tableview = qobject_cast<QQuickTableView *>(
m_target)) {
365 emit q_func()->activeChanged();
378 attached->setControl(
q);
380 if (handleItem->
z() == 0)
381 handleItem->
setZ(100);
407 if (dragHandler->
active()) {
408 const QPointF localPos = dragHandler->centroid().position();
409 const QPointF pos = handleItem->mapToItem(handleItem->parentItem(), localPos);
410 if (corner == Qt::TopLeftCorner)
411 m_selectable->setSelectionStartPos(pos);
413 m_selectable->setSelectionEndPos(pos);
415 m_draggedHandle = handleItem;
417 updateDraggingState(true);
419 QGuiApplication::setOverrideCursor(Qt::SizeFDiagCursor);
422 m_scrollTimer.stop();
423 m_selectable->normalizeSelection();
424 updateDraggingState(false);
426 QGuiApplication::restoreOverrideCursor();
473 if (
const auto flickable = qobject_cast<QQuickFlickable *>(
m_target)) {
482 const bool enabled =
q->isEnabled();
492 }
else if (
const auto flickable = qobject_cast<QQuickFlickable *>(
m_target)) {
493 if (
enabled && !flickable->isInteractive()) {
527 d->m_tapHandler->setParent(
this);
528 d->m_dragHandler->setParent(
this);
531 d->m_scrollTimer.stop();
532 d->updateSelectionMode();
533 d->updateDraggingState(
false);
534 d->updateActiveState(
false);
540 return d_func()->m_target;
549 if (
d->m_selectable) {
550 d->m_scrollTimer.stop();
551 d->m_tapHandler->setParent(
this);
552 d->m_dragHandler->setParent(
this);
553 d->m_target->disconnect(
this);
557 d->m_selectable =
nullptr;
561 if (!
d->m_selectable)
562 qmlWarning(
this) <<
"the assigned target is not supported by the control";
565 if (
d->m_selectable) {
566 const auto handlerTarget =
d->m_selectable->selectionPointerHandlerTarget();
567 d->m_dragHandler->setParentItem(handlerTarget);
568 d->m_tapHandler->setParentItem(handlerTarget);
569 d->connectToTarget();
570 d->updateSelectionMode();
578 return d_func()->m_active;
583 return d_func()->m_dragging;
588 return d_func()->m_selectionMode;
600 d->updateSelectionMode();
607 return d_func()->m_topLeftHandleDelegate;
622 return d_func()->m_bottomRightHandleDelegate;
675#include "moc_qquickselectionrectangle_p.cpp"
static QObjectPrivate * get(QObject *o)
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)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\inmodule QtCore\reentrant
constexpr qreal & ry() noexcept
Returns a reference to the y coordinate of this point.
constexpr qreal & rx() noexcept
Returns a reference to the x coordinate of this point.
The QQmlComponent class encapsulates a QML component definition.
virtual QObject * beginCreate(QQmlContext *)
Create an object instance from this component, within the specified context.
virtual void completeCreate()
This method provides advanced control over component instance creation.
static QQmlContext * contextForObject(const QObject *)
Returns the QQmlContext for the object, or nullptr if no context has been set.
void interactiveChanged()
Qt::KeyboardModifiers modifiers
void setBlocking(bool blocking)
\qmlproperty bool QtQuick::HoverHandler::blocking
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
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...
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...
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
virtual Q_INVOKABLE bool contains(const QPointF &point) const
\qmlmethod bool QtQuick::Item::contains(point point)
qreal width
This property holds the width of this item.
QQuickItem * parentItem() const
qreal height
This property holds the height of this item.
QQuickHandlerPoint centroid
void setAcceptedDevices(QInputDevice::DeviceTypes acceptedDevices)
\qmlproperty flags PointerDeviceHandler::acceptedDevices
void setGrabPermissions(GrabPermissions grabPermissions)
void setParentItem(QQuickItem *p)
void setEnabled(bool enabled)
void setTarget(QQuickItem *target)
@ CanTakeOverFromAnything
virtual void normalizeSelection()=0
virtual bool startSelection(const QPointF &pos)=0
virtual QQuickItem * selectionPointerHandlerTarget() const =0
virtual void setSelectionEndPos(const QPointF &pos)=0
virtual void clearSelection()=0
virtual QRectF selectionRectangle() const =0
virtual QSizeF scrollTowardsSelectionPoint(const QPointF &pos, const QSizeF &step)=0
virtual void setSelectionStartPos(const QPointF &pos)=0
void setControl(QQuickSelectionRectangle *control)
QQuickSelectionRectangle * control
QQuickSelectionRectangleAttached(QObject *parent)
void setDragging(bool dragging)
QQuickSelectionRectanglePrivate()
Used to select table cells inside a TableView.
QQuickSelectable * m_selectable
QQmlComponent * m_topLeftHandleDelegate
QQuickSelectionRectangle::SelectionMode m_selectionMode
void updateActiveState(bool isActive)
QQuickTapHandler * m_tapHandler
QQuickDragHandler * m_dragHandler
void updateSelectionMode()
QPointer< QQuickItem > m_draggedHandle
QQuickItem * createHandle(QQmlComponent *delegate, Qt::Corner corner)
void updateDraggingState(bool isDragging)
QPointer< QQuickItem > m_target
QScopedPointer< QQuickItem > m_topLeftHandle
QQmlComponent * m_bottomRightHandleDelegate
QScopedPointer< QQuickItem > m_bottomRightHandle
QQuickItem * handleUnderPos(const QPointF &pos)
void scrollTowardsPos(const QPointF &pos)
QQuickSelectionRectangleAttached * getAttachedObject(const QObject *object) const
QQuickSelectionRectangle::SelectionMode m_effectiveSelectionMode
void setBottomRightHandle(QQmlComponent *bottomRightHandle)
static QQuickSelectionRectangleAttached * qmlAttachedProperties(QObject *obj)
void setTarget(QQuickItem *target)
QQmlComponent * topLeftHandle
QQuickSelectionRectangle(QQuickItem *parent=nullptr)
void bottomRightHandleChanged()
void topLeftHandleChanged()
void setTopLeftHandle(QQmlComponent *topLeftHandle)
QQmlComponent * bottomRightHandle
void setSelectionMode(SelectionMode selectionMode)
SelectionMode selectionMode
void selectionModeChanged()
void setGesturePolicy(GesturePolicy gesturePolicy)
\qmlproperty enumeration QtQuick::TapHandler::gesturePolicy
void tapped(QEventPoint eventPoint, Qt::MouseButton)
\inmodule QtCore\reentrant
QRectF normalized() const noexcept
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
void stop()
Stops the timer.
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
constexpr T qAbs(const T &t)
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble GLdouble q
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QQuickAttachedPropertyPropagator * attachedObject(const QMetaObject *type, QObject *object, bool create=false)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
std::uniform_real_distribution dist(1, 2.5)
[2]
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent