MouseArea {
anchors.fill: parent
- drag.target: letter; drag.axis: Drag.XandYAxis
+ drag.target: letter; drag.axis: Drag.XAndYAxis
onPressed: letter.color = "#dddddd"
onReleased: letter.color = "#999999"
}
anchors.fill: parent
//! [drag]
drag.target: blueSquare
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: box.width - parent.width
drag.minimumY: 0
id: mouse
anchors.fill: parent
drag.target: stickyPage
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumY: 0
drag.maximumY: page.height - 80
drag.minimumX: 100
values: {
"XAxis": 1,
"YAxis": 2,
- "XandYAxis": 3
+ "XAndYAxis": 3
}
}
Property { name: "target"; type: "QQuickItem"; isPointer: true }
"NoDrag": 0,
"XAxis": 1,
"YAxis": 2,
- "XandYAxis": 3
+ "XAndYAxis": 3
}
}
Property { name: "target"; type: "QQuickItem"; isPointer: true }
#ifndef QT_NO_DRAGANDDROP
QQuickDrag::QQuickDrag(QObject *parent)
-: QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX),
+: QObject(parent), _target(0), _axis(XAndYAxis), _xmin(-FLT_MAX),
_xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX), _active(false), _filterChildren(false)
{
}
\list
\li \c drag.target specifies the id of the item to drag.
\li \c drag.active specifies if the target item is currently being dragged.
- \li \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XandYAxis)
+ \li \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XAndYAxis)
\li \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes.
\endlist
void setTarget(QQuickItem *target);
void resetTarget();
- enum Axis { XAxis=0x01, YAxis=0x02, XandYAxis=0x03 };
+ enum Axis { XAxis=0x01, YAxis=0x02, XAndYAxis=0x03, XandYAxis=XAndYAxis };
Axis axis() const;
void setAxis(Axis);
\li \c pinch.active specifies if the target item is currently being dragged.
\li \c pinch.minimumScale and \c pinch.maximumScale limit the range of the Item::scale property.
\li \c pinch.minimumRotation and \c pinch.maximumRotation limit the range of the Item::rotation property.
- \li \c pinch.dragAxis specifies whether dragging in not allowed (\c Pinch.NoDrag), can be done horizontally (\c Pinch.XAxis), vertically (\c Pinch.YAxis), or both (\c Pinch.XandYAxis)
+ \li \c pinch.dragAxis specifies whether dragging in not allowed (\c Pinch.NoDrag), can be done horizontally (\c Pinch.XAxis), vertically (\c Pinch.YAxis), or both (\c Pinch.XAndYAxis)
\li \c pinch.minimum and \c pinch.maximum limit how far the target can be dragged along the corresponding axes.
\endlist
*/
emit maximumRotationChanged();
}
- enum Axis { NoDrag=0x00, XAxis=0x01, YAxis=0x02, XandYAxis=0x03 };
+ enum Axis { NoDrag=0x00, XAxis=0x01, YAxis=0x02, XAndYAxis=0x03, XandYAxis=XAndYAxis };
Axis axis() const { return m_axis; }
void setAxis(Axis a) {
if (a == m_axis)
objectName: "mouseregion"
anchors.fill: parent
drag.target: blackRect
- drag.axis: blackRect.x <= 75 ? Drag.XandYAxis : Drag.YAxis
+ drag.axis: blackRect.x <= 75 ? Drag.XAndYAxis : Drag.YAxis
}
}
}
objectName: "mouseregion"
anchors.fill: parent
drag.target: blackRect
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: whiteRect.width-blackRect.width
drag.minimumY: 0
objectName: "mouseregion"
anchors.fill: parent
drag.target: blackRect
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: whiteRect.width-blackRect.width
drag.minimumY: 0
objectName: "mouseregion"
anchors.fill: parent
drag.target: haveTarget ? blackRect : undefined
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: whiteRect.width-blackRect.width
drag.minimumY: 0
QCOMPARE(targetSpy.count(),1);
// axis
- QCOMPARE(drag->axis(), QQuickDrag::XandYAxis);
+ QCOMPARE(drag->axis(), QQuickDrag::XAndYAxis);
QSignalSpy axisSpy(drag, SIGNAL(axisChanged()));
drag->setAxis(QQuickDrag::XAxis);
QCOMPARE(drag->axis(), QQuickDrag::XAxis);
QTRY_VERIFY(drag->active());
QCOMPARE(blackRect->x(), 72.0);
QCOMPARE(blackRect->y(), 72.0);
- QCOMPARE(drag->axis(), QQuickDrag::XandYAxis);
+ QCOMPARE(drag->axis(), QQuickDrag::XAndYAxis);
/* When blackRect.x becomes bigger than 75, the drag axis is changed to
* Drag.YAxis by the QML code. Verify that this happens, and that the drag
objectName: "pincharea"
anchors.fill: parent
pinch.target: blackRect
- pinch.dragAxis: Drag.XandYAxis
+ pinch.dragAxis: Drag.XAndYAxis
pinch.minimumX: 0
pinch.maximumX: whiteRect.width-blackRect.width
pinch.minimumY: 0
property bool pinching: false
pinch.target: rect
- pinch.dragAxis: Drag.XandYAxis
+ pinch.dragAxis: Drag.XAndYAxis
onPinchStarted: pinching = true
onPinchFinished: pinching = false
}
QCOMPARE(targetSpy.count(),1);
// axis
- QCOMPARE(pinch->axis(), QQuickPinch::XandYAxis);
+ QCOMPARE(pinch->axis(), QQuickPinch::XAndYAxis);
QSignalSpy axisSpy(pinch, SIGNAL(dragAxisChanged()));
pinch->setAxis(QQuickPinch::XAxis);
QCOMPARE(pinch->axis(), QQuickPinch::XAxis);
MouseArea {
anchors.fill: parent
drag.target: blueSquare
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: box.width - parent.width
drag.minimumY: 0
MouseArea {
anchors.fill: parent
drag.target: parent
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: wooohooo.width - parent.width
drag.minimumY: 0
MouseArea {
anchors.fill: parent
drag.target: parent
- drag.axis: Drag.XandYAxis
+ drag.axis: Drag.XAndYAxis
drag.minimumX: 0
drag.maximumX: parent.parent.width - width
drag.minimumY: 0