QQuickWindow *view = m_item->window();
if (view->contentItem()) {
scaleFactor = view->contentItem()->scale();
- originOffset -= view->contentItem()->pos();
+ originOffset -= view->contentItem()->position();
}
// The scale transform for the overlay needs to be cancelled
// as the Item's transform which will be applied to the painter
// takes care of it.
parentItem()->setScale(1/scaleFactor);
- setPos(originOffset);
+ setPosition(originOffset);
update();
}
m_didPressAndHold(false),
m_tapEvent(false),
m_contentItem(view->contentItem()),
- m_originalPosition(view->contentItem()->pos()),
+ m_originalPosition(view->contentItem()->position()),
m_smoothScaleFactor(Constants::ZoomSnapDelta),
m_minScale(0.125f),
m_maxScale(48.0f),
// restoring the original states.
if (m_contentItem) {
m_contentItem->setScale(m_originalScale);
- m_contentItem->setPos(m_originalPosition);
+ m_contentItem->setPosition(m_originalPosition);
m_contentItem->setSmooth(m_originalSmooth);
}
} else {
if (m_contentItem) {
m_originalSmooth = m_contentItem->smooth();
m_originalScale = m_contentItem->scale();
- m_originalPosition = m_contentItem->pos();
+ m_originalPosition = m_contentItem->position();
m_contentItem->setSmooth(true);
}
}
return;
}
//New position = new center + scalefactor * (oldposition - oldcenter)
- QPointF newPosition = newcenter + (factor * (m_contentItem->pos() - oldcenter));
+ QPointF newPosition = newcenter + (factor * (m_contentItem->position() - oldcenter));
m_contentItem->setScale(m_contentItem->scale() * factor);
- m_contentItem->setPos(newPosition);
+ m_contentItem->setPosition(newPosition);
}
void InspectTool::zoomIn()
{
m_didPressAndHold = true;
- m_contentItem->setPos(QPointF(0, 0));
+ m_contentItem->setPosition(QPointF(0, 0));
m_contentItem->setScale(1.0);
}
void InspectTool::dragItemToPosition()
{
- QPointF newPosition = m_contentItem->pos() + m_mousePosition - m_dragStartPosition;
+ QPointF newPosition = m_contentItem->position() + m_mousePosition - m_dragStartPosition;
m_dragStartPosition = m_mousePosition;
- m_contentItem->setPos(newPosition);
+ m_contentItem->setPosition(newPosition);
}
void InspectTool::moveItem(bool valid)
void QQuickAnchorsPrivate::setItemPos(const QPointF &v)
{
updatingMe = true;
- item->setPos(v);
+ item->setPosition(v);
updatingMe = false;
}
qreal y = (verticalLayoutDirection == QQuickItemView::TopToBottom)
? rowPosAt(index)
: -rowPosAt(index) - item->height();
- item->setPos(QPointF(colPosAt(index), y));
+ item->setPosition(QPointF(colPosAt(index), y));
}
} else {
if (item->x() + item->width() > pos && item->x() < pos + q->width()) {
? colPosAt(index)
: -colPosAt(index) - item->height();
if (flow == QQuickGridView::FlowTopToBottom && q->effectiveLayoutDirection() == Qt::RightToLeft)
- item->setPos(QPointF(-rowPosAt(index)-item->width(), y));
+ item->setPosition(QPointF(-rowPosAt(index)-item->width(), y));
else
- item->setPos(QPointF(rowPosAt(index), y));
+ item->setPosition(QPointF(rowPosAt(index), y));
}
}
}
/*!
\internal
*/
-QPointF QQuickItem::pos() const
+QPointF QQuickItem::position() const
{
Q_D(const QQuickItem);
return QPointF(d->x, d->y);
/*!
\internal
*/
-void QQuickItem::setPos(const QPointF &pos)
+void QQuickItem::setPosition(const QPointF &pos)
{
Q_D(QQuickItem);
if (QPointF(d->x, d->y) == pos)
debug << item->metaObject()->className() << "(this =" << ((void*)item)
<< ", name=" << item->objectName()
<< ", parent =" << ((void*)item->parentItem())
- << ", geometry =" << QRectF(item->pos(), QSizeF(item->width(), item->height()))
+ << ", geometry =" << QRectF(item->position(), QSizeF(item->width(), item->height()))
<< ", z =" << item->z() << ')';
return debug;
}
Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QObject> resources READ resources DESIGNABLE false)
Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQmlListProperty<QQuickItem> children READ children NOTIFY childrenChanged DESIGNABLE false)
- Q_PROPERTY(QPointF pos READ pos FINAL)
Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL)
Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL)
Q_PROPERTY(qreal z READ z WRITE setZ NOTIFY zChanged FINAL)
qreal x() const;
qreal y() const;
- QPointF pos() const;
+ QPointF position() const;
void setX(qreal);
void setY(qreal);
- void setPos(const QPointF &);
+ void setPosition(const QPointF &);
qreal width() const;
void setWidth(qreal);
QPointF pathPos = QQuickPath::sequentialPointAt(prevData.painterPath, prevData.pathLength, prevData.attributePoints, prevData.prevBez, prevData.currentV);
if (!prevData.anchorPoint.isNull())
pathPos -= prevData.anchorPoint;
- if (pathPos == data->target->pos()) { //only treat as interruption if we interrupted ourself
+ if (pathPos == data->target->position()) { //only treat as interruption if we interrupted ourself
data->painterPath = prevData.painterPath;
data->toDefined = data->fromDefined = data->fromSourced = true;
data->prevBez.isValid = false;
}
}
- target->setPos(currentPos);
+ target->setPosition(currentPos);
//adjust angle according to orientation
if (!fixed) {
if (transitionableItem)
transitionableItem->moveTo(pos, immediate);
else
- item->setPos(pos);
+ item->setPosition(pos);
}
void FxViewItem::setVisible(bool visible)
void QQuickItemViewTransitionableItem::moveTo(const QPointF &pos, bool immediate)
{
if (!nextTransitionFromSet && nextTransitionType != QQuickItemViewTransitioner::NoTransition) {
- nextTransitionFrom = item->pos();
+ nextTransitionFrom = item->position();
nextTransitionFromSet = true;
}
if (immediate || !transitionScheduledOrRunning()) {
if (immediate)
stopTransition();
- item->setPos(pos);
+ item->setPosition(pos);
} else {
nextTransitionTo = pos;
nextTransitionToSet = true;
// This ensures that removed targets don't transition to the default (0,0) and that
// items set for other transition types only transition if they actually move somewhere.
if (!nextTransitionToSet)
- moveTo(item->pos());
+ moveTo(item->position());
} else {
// don't start displaced transitions that don't move anywhere
if (!nextTransitionToSet || (nextTransitionFromSet && nextTransitionFrom == nextTransitionTo)) {
if (!doTransition) {
// if transition type is not valid, the previous transition still has to be
// canceled so that the item can move immediately to the right position
- item->setPos(nextTransitionTo);
+ item->setPosition(nextTransitionTo);
stopTransition();
}
if (d->drag && d->drag->target()) {
if (!d->moved) {
d->targetStartPos = d->drag->target()->parentItem()
- ? d->drag->target()->parentItem()->mapToScene(d->drag->target()->pos())
- : d->drag->target()->pos();
+ ? d->drag->target()->parentItem()->mapToScene(d->drag->target()->position())
+ : d->drag->target()->position();
}
QPointF startLocalPos;
? d->drag->target()->parentItem()->mapFromScene(d->targetStartPos)
: d->targetStartPos;
- QPointF dragPos = d->drag->target()->pos();
+ QPointF dragPos = d->drag->target()->position();
bool dragX = drag()->axis() & QQuickDrag::XAxis;
bool dragY = drag()->axis() & QQuickDrag::YAxis;
y = drag()->ymax();
dragPos.setY(y);
}
- d->drag->target()->setPos(dragPos);
+ d->drag->target()->setPosition(dragPos);
if (!keepMouseGrab()) {
bool xDragged = QQuickWindowPrivate::dragOverThreshold(dx, Qt::XAxis, event);
grabMouse();
setKeepMouseGrab(true);
if (d->pinch && d->pinch->target()) {
- d->pinchStartPos = pinch()->target()->pos();
+ d->pinchStartPos = pinch()->target()->position();
d->pinchStartScale = d->pinch->target()->scale();
d->pinchStartRotation = d->pinch->target()->rotation();
d->pinch->setActive(true);
if (transitionableItem)
transitionableItem->moveTo(pos);
else
- item->setPos(pos);
+ item->setPosition(pos);
}
void QQuickBasePositioner::PositionedItem::transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget)
if (ok) {
//qDebug() << x << y << rotation << scale;
- target->setPos(QPointF(x, y));
+ target->setPosition(QPointF(x, y));
target->setRotation(target->rotation() + rotation);
target->setScale(target->scale() * scale);
}
emit cursorRectangleChanged();
if (d->cursorItem) {
QRectF r = cursorRectangle();
- d->cursorItem->setPos(r.topLeft());
+ d->cursorItem->setPosition(r.topLeft());
d->cursorItem->setHeight(r.height());
}
#ifndef QT_NO_IM
if ((item = qobject_cast<QQuickItem *>(object))) {
QQml_setParent_noEvent(item, parent);
item->setParentItem(parent);
- item->setPos(rectangle.topLeft());
+ item->setPosition(rectangle.topLeft());
item->setHeight(rectangle.height());
} else {
qmlInfo(parent) << tr("%1 does not support loading non-visual cursor delegates.")
QTest::qWait(animation.duration());
QTIMED_COMPARE(rect.x(), 200.0);
- rect.setPos(QPointF(0,0));
+ rect.setPosition(QPointF(0,0));
animation.start();
QVERIFY(animation.isRunning());
animation.pause();
QCOMPARE(dropTarget.enterEvents, 1); QCOMPARE(dropTarget.leaveEvents, 0); QCOMPARE(dropTarget.moveEvents, 0);
dropTarget.reset();
- item->setPos(QPointF(80, 80));
+ item->setPosition(QPointF(80, 80));
QCOMPARE(evaluate<bool>(item, "Drag.active"), true);
QCOMPARE(evaluate<bool>(item, "dragActive"), true);
QCOMPARE(dropTarget.enterEvents, 0); QCOMPARE(dropTarget.leaveEvents, 0); QCOMPARE(dropTarget.moveEvents, 0);
// Queued move event is delivered before a drop event.
innerTarget.reset(); outerTarget.reset();
evaluate<void>(item, "Drag.active = true");
- item->setPos(QPointF(80, 80));
+ item->setPosition(QPointF(80, 80));
evaluate<void>(item, "Drag.drop()");
QCOMPARE(evaluate<bool>(item, "Drag.active"), false);
QCOMPARE(evaluate<bool>(item, "dragActive"), false);
TestDropTarget outerTarget(window.contentItem());
outerTarget.setSize(QSizeF(100, 100));
TestDropTarget leftTarget(&outerTarget);
- leftTarget.setPos(QPointF(0, 35));
+ leftTarget.setPosition(QPointF(0, 35));
leftTarget.setSize(QSizeF(30, 30));
TestDropTarget rightTarget(&outerTarget);
- rightTarget.setPos(QPointF(70, 35));
+ rightTarget.setPosition(QPointF(70, 35));
rightTarget.setSize(QSizeF(30, 30));
QQmlComponent component(&engine);
component.setData(
// Move within the outer target.
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(60, 50));
+ item->setPosition(QPointF(60, 50));
// Move event is delivered in the event loop.
QCOMPARE(outerTarget.enterEvents, 0); QCOMPARE(outerTarget.leaveEvents, 0); QCOMPARE(outerTarget.moveEvents, 0);
QCOMPARE(leftTarget .enterEvents, 0); QCOMPARE(leftTarget .leaveEvents, 0); QCOMPARE(leftTarget .moveEvents, 0);
// Move into the left target.
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(25, 50));
+ item->setPosition(QPointF(25, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&leftTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&leftTarget));
// Move within the left target.
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(25, 40));
+ item->setPosition(QPointF(25, 40));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&leftTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&leftTarget));
// Move out of all targets.
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(110, 50));
+ item->setPosition(QPointF(110, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(0));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(0));
rightTarget.accept = false;
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(80, 50));
+ item->setPosition(QPointF(80, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&outerTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&outerTarget));
outerTarget.accept = false;
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(60, 50));
+ item->setPosition(QPointF(60, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&outerTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&outerTarget));
outerTarget.setFlags(QQuickItem::Flags());
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(40, 50));
+ item->setPosition(QPointF(40, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&outerTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&outerTarget));
leftTarget.setFlags(QQuickItem::Flags());
outerTarget.reset(); leftTarget.reset(); rightTarget.reset();
- item->setPos(QPointF(25, 50));
+ item->setPosition(QPointF(25, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<QObject *>(item, "Drag.target"), static_cast<QObject *>(&outerTarget));
QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&outerTarget));
QCOMPARE(dropTarget.position.x(), qreal(55));
QCOMPARE(dropTarget.position.y(), qreal(55));
- item->setPos(QPointF(30, 20));
+ item->setPosition(QPointF(30, 20));
QCoreApplication::processEvents();
QCOMPARE(dropTarget.position.x(), qreal(35));
QCOMPARE(dropTarget.position.y(), qreal(25));
QCOMPARE(dropTarget.position.x(), qreal(40));
QCOMPARE(dropTarget.position.y(), qreal(30));
- item->setPos(QPointF(10, 20));
+ item->setPosition(QPointF(10, 20));
QCoreApplication::processEvents();
QCOMPARE(dropTarget.position.x(), qreal(20));
QCOMPARE(dropTarget.position.y(), qreal(30));
evaluate<void>(item, "Drag.supportedActions = Qt.MoveAction");
QCOMPARE(evaluate<bool>(item, "Drag.supportedActions == Qt.MoveAction"), true);
QCOMPARE(evaluate<bool>(item, "supportedActions == Qt.MoveAction"), true);
- item->setPos(QPointF(60, 60));
+ item->setPosition(QPointF(60, 60));
QCOMPARE(dropTarget.supportedActions, Qt::CopyAction | Qt::MoveAction);
QCOMPARE(dropTarget.leaveEvents, 0);
QCOMPARE(dropTarget.enterEvents, 1);
evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }");
- dragItem->setPos(QPointF(150, 50));
+ dragItem->setPosition(QPointF(150, 50));
evaluate<void>(dragItem, "Drag.active = true");
QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false);
QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false);
QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0);
QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0);
- dragItem->setPos(QPointF(50, 50));
+ dragItem->setPosition(QPointF(50, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), true);
QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), true);
QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0);
evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }");
- dragItem->setPos(QPointF(150, 50));
+ dragItem->setPosition(QPointF(150, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false);
QCOMPARE(evaluate<qreal>(dropArea, "eventY"), qreal(50));
evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }");
- dragItem->setPos(QPointF(40, 50));
+ dragItem->setPosition(QPointF(40, 50));
QCoreApplication::processEvents();
QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0);
QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1);
QCOMPARE(evaluate<qreal>(dropArea, "eventY"), qreal(50));
evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }");
- dragItem->setPos(QPointF(75, 25));
+ dragItem->setPosition(QPointF(75, 25));
QCoreApplication::processEvents();
QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0);
QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1);
firstPos.rx() = flow == QQuickGridView::FlowLeftToRight ? gridview->width() - gridview->cellWidth() : -gridview->cellWidth();
if (verticalLayout == QQuickItemView::BottomToTop)
firstPos.ry() -= gridview->cellHeight();
- QCOMPARE(item0->pos(), firstPos);
+ QCOMPARE(item0->position(), firstPos);
QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper");
int firstVisibleIndex = -1;
for (int i = firstVisibleIndex; i < model.count() && i < items.count(); ++i) {
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i);
QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i)));
- QCOMPARE(item->pos(), expectedItemPos(gridview, i, rowOffsetAfterMove));
+ QCOMPARE(item->position(), expectedItemPos(gridview, i, rowOffsetAfterMove));
QQuickText *name = findItem<QQuickText>(contentItem, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
for (int i = firstVisibleIndex; i < model.count() && i < items.count(); ++i) {
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i);
QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i)));
- QCOMPARE(item->pos(), expectedItemPos(gridview, i, rowOffsetAfterMove));
+ QCOMPARE(item->position(), expectedItemPos(gridview, i, rowOffsetAfterMove));
QQuickText *name = findItem<QQuickText>(contentItem, "textName", i);
QVERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
continue; // index has moved out of view
}
QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i)));
- QCOMPARE(item->pos(), expectedItemPos(gridview, i, rowOffsetAfterMove));
+ QCOMPARE(item->position(), expectedItemPos(gridview, i, rowOffsetAfterMove));
QQuickText *name = findItem<QQuickText>(contentItem, "textName", i);
QVERIFY(name != 0);
QTRY_COMPARE(name->text(), model.name(i));
QVERIFY(footer);
QVERIFY(footer == gridview->footerItem());
- QCOMPARE(footer->pos(), initialFooterPos);
+ QCOMPARE(footer->position(), initialFooterPos);
QCOMPARE(footer->width(), 100.);
QCOMPARE(footer->height(), 30.);
QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos);
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
if (flow == QQuickGridView::FlowLeftToRight) {
// shrink by one row
posWhenNoItems.setX(flow == QQuickGridView::FlowLeftToRight ? gridview->width() - footer->width() : -footer->width());
if (verticalLayoutDirection == QQuickItemView::BottomToTop)
posWhenNoItems.setY(-footer->height());
- QTRY_COMPARE(footer->pos(), posWhenNoItems);
+ QTRY_COMPARE(footer->position(), posWhenNoItems);
// if header is toggled, it shouldn't affect the footer position
window->rootObject()->setProperty("showHeader", true);
QVERIFY(findItem<QQuickItem>(contentItem, "header") != 0);
- QTRY_COMPARE(footer->pos(), posWhenNoItems);
+ QTRY_COMPARE(footer->position(), posWhenNoItems);
window->rootObject()->setProperty("showHeader", false);
// add 30 items
QVERIFY(footer);
QVERIFY(footer == gridview->footerItem());
- QCOMPARE(footer->pos(), changedFooterPos);
+ QCOMPARE(footer->position(), changedFooterPos);
QCOMPARE(footer->width(), 50.);
QCOMPARE(footer->height(), 20.);
item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
gridview->positionViewAtEnd();
footer->setHeight(10);
QVERIFY(header);
QVERIFY(header == gridview->headerItem());
- QCOMPARE(header->pos(), initialHeaderPos);
+ QCOMPARE(header->position(), initialHeaderPos);
QCOMPARE(header->width(), 100.);
QCOMPARE(header->height(), 30.);
QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos);
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
model.clear();
QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false);
- QCOMPARE(header->pos(), initialHeaderPos); // header should stay where it is
+ QCOMPARE(header->position(), initialHeaderPos); // header should stay where it is
if (flow == QQuickGridView::FlowLeftToRight)
QCOMPARE(gridview->contentHeight(), header->height());
else
QVERIFY(header == gridview->headerItem());
- QCOMPARE(header->pos(), changedHeaderPos);
+ QCOMPARE(header->position(), changedHeaderPos);
QCOMPARE(header->width(), 50.);
QCOMPARE(header->height(), 20.);
QTRY_COMPARE(QPointF(gridview->contentX(), gridview->contentY()), changedContentPos);
item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
header->setHeight(10);
header->setWidth(40);
gridview->setWidth(240);
gridview->setHeight(320);
- QTRY_COMPARE(gridview->headerItem()->pos(), initialHeaderPos);
+ QTRY_COMPARE(gridview->headerItem()->position(), initialHeaderPos);
QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos);
releaseView(window);
QQuickItem *header = findItem<QQuickItem>(contentItem, "header");
QVERIFY(header);
- QCOMPARE(header->pos(), headerPos);
+ QCOMPARE(header->position(), headerPos);
QQuickItem *footer = findItem<QQuickItem>(contentItem, "footer");
QVERIFY(footer);
- QCOMPARE(footer->pos(), footerPos);
+ QCOMPARE(footer->position(), footerPos);
QCOMPARE(static_cast<GVAccessor*>(gridview)->minX(), minPos.x());
QCOMPARE(static_cast<GVAccessor*>(gridview)->minY(), minPos.y());
QQuickItem *item0 = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item0);
- QCOMPARE(item0->pos(), firstItemPos);
+ QCOMPARE(item0->position(), firstItemPos);
// Confirm items positioned correctly and indexes correct
QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper");
for (int i = 0; i < model.count() && i < items.count(); ++i) {
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i);
QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i)));
- QCOMPARE(item->pos(), expectedItemPos(gridview, i, 0));
+ QCOMPARE(item->position(), expectedItemPos(gridview, i, 0));
QQuickText *name = findItem<QQuickText>(contentItem, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
QCOMPARE(findItem<QQuickItem>(contentItem, "wrapper", 0), item0);
if (flow == QQuickGridView::FlowLeftToRight && layoutDirection == Qt::RightToLeft)
firstItemPos.rx() += 80;
- QCOMPARE(item0->pos(), firstItemPos);
+ QCOMPARE(item0->position(), firstItemPos);
QPointF newContentPos = initialContentPos;
if (flow == QQuickGridView::FlowTopToBottom && layoutDirection == Qt::RightToLeft)
for (int i = 0; i < model.count() && i < items.count(); ++i) {
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i);
QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i)));
- QCOMPARE(item->pos(), expectedItemPos(gridview, i, 0));
+ QCOMPARE(item->position(), expectedItemPos(gridview, i, 0));
QQuickText *name = findItem<QQuickText>(contentItem, "textName", i);
QVERIFY(name != 0);
QCOMPARE(name->text(), model.name(i));
HoverItem *rightItem = new HoverItem(parentItem);
rightItem->setSize(QSizeF(100, 200));
- rightItem->setPos(QPointF(100, 0));
+ rightItem->setPosition(QPointF(100, 0));
rightItem->setAcceptHoverEvents(true);
const QPoint insideLeft(50, 100);
QCOMPARE(header->width(), 100.);
QCOMPARE(header->height(), 30.);
- QCOMPARE(header->pos(), initialHeaderPos);
+ QCOMPARE(header->position(), initialHeaderPos);
QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos);
if (orientation == QQuickListView::Vertical)
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
model.clear();
QTRY_COMPARE(listview->count(), model.count());
- QCOMPARE(header->pos(), initialHeaderPos); // header should stay where it is
+ QCOMPARE(header->position(), initialHeaderPos); // header should stay where it is
if (orientation == QQuickListView::Vertical)
QCOMPARE(listview->contentHeight(), header->height());
else
QVERIFY(header == listview->headerItem());
- QCOMPARE(header->pos(), changedHeaderPos);
+ QCOMPARE(header->position(), changedHeaderPos);
QCOMPARE(header->width(), 50.);
QCOMPARE(header->height(), 20.);
QTRY_COMPARE(QPointF(listview->contentX(), listview->contentY()), changedContentPos);
item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
listview->positionViewAtBeginning();
header->setHeight(10);
listview->setWidth(240);
listview->setHeight(320);
- QTRY_COMPARE(listview->headerItem()->pos(), initialHeaderPos);
+ QTRY_COMPARE(listview->headerItem()->position(), initialHeaderPos);
QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos);
releaseView(window);
QVERIFY(footer == listview->footerItem());
- QCOMPARE(footer->pos(), initialFooterPos);
+ QCOMPARE(footer->position(), initialFooterPos);
QCOMPARE(footer->width(), 100.);
QCOMPARE(footer->height(), 30.);
QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos);
QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
// remove one item
model.removeItem(1);
posWhenNoItems.setX(-100);
else if (orientation == QQuickListView::Vertical && verticalLayoutDirection == QQuickItemView::BottomToTop)
posWhenNoItems.setY(-30);
- QTRY_COMPARE(footer->pos(), posWhenNoItems);
+ QTRY_COMPARE(footer->position(), posWhenNoItems);
// if header is present, it's at a negative pos, so the footer should not move
window->rootObject()->setProperty("showHeader", true);
- QTRY_COMPARE(footer->pos(), posWhenNoItems);
+ QTRY_COMPARE(footer->position(), posWhenNoItems);
window->rootObject()->setProperty("showHeader", false);
// add 30 items
QVERIFY(footer == listview->footerItem());
- QCOMPARE(footer->pos(), changedFooterPos);
+ QCOMPARE(footer->position(), changedFooterPos);
QCOMPARE(footer->width(), 50.);
QCOMPARE(footer->height(), 20.);
QTRY_COMPARE(QPointF(listview->contentX(), listview->contentY()), changedContentPos);
item = findItem<QQuickItem>(contentItem, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(item->pos(), firstDelegatePos);
+ QCOMPARE(item->position(), firstDelegatePos);
listview->positionViewAtEnd();
footer->setHeight(10);
QQuickItem *header = findItem<QQuickItem>(contentItem, "header");
QVERIFY(header);
- QCOMPARE(header->pos(), headerPos);
+ QCOMPARE(header->position(), headerPos);
QQuickItem *footer = findItem<QQuickItem>(contentItem, "footer");
QVERIFY(footer);
- QCOMPARE(footer->pos(), footerPos);
+ QCOMPARE(footer->position(), footerPos);
QCOMPARE(static_cast<LVAccessor*>(listview)->minX(), minPos.x());
QCOMPARE(static_cast<LVAccessor*>(listview)->minY(), minPos.y());
QQuickItem *positioner = findItem<QQuickItem>(window->rootObject(), "positioner");
QVERIFY(positioner);
QTRY_COMPARE(positioner->boundingRect().size(), origPositionerRect.size());
- QTRY_COMPARE(positioner->pos(), origPositionerRect.topLeft());
+ QTRY_COMPARE(positioner->position(), origPositionerRect.topLeft());
QSignalSpy spy(listview, orientation == QQuickListView::Vertical ? SIGNAL(contentYChanged()) : SIGNAL(contentXChanged()));
int prevSpyCount = 0;
prevSpyCount = spy.count();
QVERIFY(QMetaObject::invokeMethod(window->rootObject(), "incrementRepeater"));
QTRY_COMPARE(positioner->boundingRect().size(), resizedPositionerRect.size());
- QTRY_COMPARE(positioner->pos(), resizedPositionerRect.topLeft());
+ QTRY_COMPARE(positioner->position(), resizedPositionerRect.topLeft());
QCOMPARE(listview->contentX(), contentPos_itemFirstHalfVisible.x());
QCOMPARE(listview->contentY(), contentPos_itemFirstHalfVisible.y());
QCOMPARE(spy.count(), prevSpyCount);
QVERIFY(QMetaObject::invokeMethod(window->rootObject(), "decrementRepeater"));
QTRY_COMPARE(positioner->boundingRect().size(), origPositionerRect.size());
- QTRY_COMPARE(positioner->pos(), origPositionerRect.topLeft());
+ QTRY_COMPARE(positioner->position(), origPositionerRect.topLeft());
QCOMPARE(listview->contentX(), contentPos_itemFirstHalfVisible.x());
QCOMPARE(listview->contentY(), contentPos_itemFirstHalfVisible.y());
QVERIFY(QMetaObject::invokeMethod(window->rootObject(), "incrementRepeater"));
positioner = findItem<QQuickItem>(window->rootObject(), "positioner");
QTRY_COMPARE(positioner->boundingRect().size(), resizedPositionerRect.size());
- QTRY_COMPARE(positioner->pos(), resizedPositionerRect.topLeft());
+ QTRY_COMPARE(positioner->position(), resizedPositionerRect.topLeft());
QCOMPARE(listview->contentX(), contentPos_itemSecondHalfVisible.x());
QCOMPARE(listview->contentY(), contentPos_itemSecondHalfVisible.y());
qApp->processEvents();
QCOMPARE(mouseRegion->mouseX(), 0.0);
QCOMPARE(mouseRegion->mouseY(), 0.0);
- QMouseEvent event(QEvent::MouseButtonPress, rect->pos().toPoint(), Qt::LeftButton, Qt::LeftButton, 0);
+ QMouseEvent event(QEvent::MouseButtonPress, rect->position().toPoint(), Qt::LeftButton, Qt::LeftButton, 0);
QGuiApplication::sendEvent(window, &event);
QVERIFY(!mouseRegion->property("emitPositionChanged").toBool());
QPointF offset;
offset.setX(pathview->highlightItem()->width()/2);
offset.setY(pathview->highlightItem()->height()/2);
- QCOMPARE(pathview->highlightItem()->pos() + offset, start);
+ QCOMPARE(pathview->highlightItem()->position() + offset, start);
delete window;
}
QPointF offset;//Center of item is at point, but pos is from corner
offset.setX(firstItem->width()/2);
offset.setY(firstItem->height()/2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
pathview->setOffset(1.0);
for (int i=0; i<model.count(); i++) {
QQuickRectangle *curItem = findItem<QQuickRectangle>(pathview, "wrapper", i);
QPointF itemPos(path->pointAt(0.25 + i*0.25));
- QCOMPARE(curItem->pos() + offset, QPointF(itemPos.x(), itemPos.y()));
+ QCOMPARE(curItem->position() + offset, QPointF(itemPos.x(), itemPos.y()));
}
QCOMPARE(pathview->currentIndex(), 3);
pathview->setOffset(0.0);
- QCOMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentIndex(), 0);
// Change delegate size
window->rootObject()->setProperty("delegateWidth", 30);
QCOMPARE(firstItem->width(), 30.0);
offset.setX(firstItem->width()/2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
// Change delegate scale
pathview->setOffset(0.1);
pathview->setOffset(0.0);
window->rootObject()->setProperty("delegateScale", 1.2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
delete window;
}
QPointF offset;//Center of item is at point, but pos is from corner
offset.setX(firstItem->width()/2);
offset.setY(firstItem->height()/2);
- QCOMPARE(firstItem->pos() + offset, start);
+ QCOMPARE(firstItem->position() + offset, start);
QCOMPARE(window->rootObject()->property("currentA").toInt(), 0);
QCOMPARE(window->rootObject()->property("currentB").toInt(), 0);
pathview->setCurrentIndex(2);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(window->rootObject()->property("currentA").toInt(), 2);
QCOMPARE(window->rootObject()->property("currentB").toInt(), 2);
QCOMPARE(pathview->currentItem(), firstItem);
QTRY_COMPARE(pathview->currentIndex(), 1);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 1);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
QTRY_COMPARE(pathview->currentIndex(), 0);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
QTRY_COMPARE(pathview->currentIndex(), 3);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 3);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
QTRY_COMPARE(pathview->currentIndex(), 0);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
QTRY_COMPARE(pathview->currentIndex(), 2);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 2);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
QTRY_COMPARE(pathview->currentIndex(), 1);
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 1);
QVERIFY(firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 3);
QVERIFY(firstItem);
QCOMPARE(pathview->currentItem(), firstItem);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
model.moveItem(3, 0);
pathview->setCurrentIndex(0);
pathview->setHighlightMoveDuration(300);
QPointF offset;//Center of item is at point, but pos is from corner
offset.setX(firstItem->width()/2);
offset.setY(firstItem->height()/2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
pathview->setPreferredHighlightBegin(0.8);
pathview->setPreferredHighlightEnd(0.8);
start = path->pointAt(0.8);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentIndex(), 0);
delete window;
QPointF offset;//Center of item is at point, but pos is from corner
offset.setX(item->width()/2);
offset.setY(item->height()/2);
- QCOMPARE(item->pos() + offset, start);
+ QCOMPARE(item->position() + offset, start);
QSignalSpy currentIndexSpy(pathview, SIGNAL(currentIndexChanged()));
QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
// verify that current item (item 1) is still at offset 0.5
- QCOMPARE(item->pos() + offset, start);
+ QCOMPARE(item->position() + offset, start);
// insert another item at the beginning
model.insertItem(0, "item2", "2");
QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 2));
// verify that current item (item 2) is still at offset 0.5
- QCOMPARE(item->pos() + offset, start);
+ QCOMPARE(item->position() + offset, start);
// verify that remove before current maintains current item
model.removeItem(0);
QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
// verify that current item (item 1) is still at offset 0.5
- QCOMPARE(item->pos() + offset, start);
+ QCOMPARE(item->position() + offset, start);
delete window;
}
QPointF offset;//Center of item is at point, but pos is from corner
offset.setX(firstItem->width()/2);
offset.setY(firstItem->height()/2);
- QTRY_COMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->position() + offset, start);
pathview->setOffset(1.0);
for (int i=0; i<5; i++) {
QQuickItem *curItem = findItem<QQuickItem>(pathview, "wrapper", i);
QPointF itemPos(path->pointAt(0.2 + i*0.2));
- QCOMPARE(curItem->pos() + offset, itemPos);
+ QCOMPARE(curItem->position() + offset, itemPos);
}
delete window;
QCoreApplication::sendEvent(edit, &query);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(edit->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QCOMPARE(currentRect, previousRect);
// Verify that the micro focus rect moves to the left as the cursor position
QCoreApplication::sendEvent(edit, &query);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(edit->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QVERIFY(previousRect.left() < currentRect.left());
QCOMPARE(editSpy.count(), 1); editSpy.clear();
QCOMPARE(panelSpy.count(), 1); panelSpy.clear();
QCoreApplication::sendEvent(edit, &query);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(edit->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QCOMPARE(editSpy.count(), 1);
QCOMPARE(panelSpy.count(), 1);
QCoreApplication::sendEvent(edit, &query);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(edit->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QCOMPARE(currentRect, previousRect);
QCOMPARE(editSpy.count(), 1);
QCOMPARE(panelSpy.count(), 1);
QCOMPARE(input->displayText(), QString(4, fillChar));
QTest::keyPress(&window, '4');
QCOMPARE(input->displayText(), QString(4, fillChar) + QLatin1Char('4'));
- QCOMPARE(input->cursorRectangle().topLeft(), cursor->pos());
+ QCOMPARE(input->cursorRectangle().topLeft(), cursor->position());
// Verify the last character entered is replaced by the fill character after a delay.
// Also check the cursor position is updated to accomdate a size difference between
QTest::qWait(maskDelay);
QTRY_COMPARE(input->displayText(), QString(5, fillChar));
QCOMPARE(cursorSpy.count(), 1);
- QCOMPARE(input->cursorRectangle().topLeft(), cursor->pos());
+ QCOMPARE(input->cursorRectangle().topLeft(), cursor->position());
QTest::keyPress(&window, '5');
QCOMPARE(input->displayText(), QString(5, fillChar) + QLatin1Char('5'));
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(currentRect, previousRect);
QCOMPARE(input->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QSignalSpy inputSpy(input, SIGNAL(cursorRectangleChanged()));
QSignalSpy panelSpy(qGuiApp->inputMethod(), SIGNAL(cursorRectangleChanged()));
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QVERIFY(previousRect.left() < currentRect.left());
QCOMPARE(input->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QVERIFY(inputSpy.count() > 0); inputSpy.clear();
QVERIFY(panelSpy.count() > 0); panelSpy.clear();
previousRect = currentRect;
QCoreApplication::sendEvent(input, &query);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(input->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QCOMPARE(inputSpy.count(), 1);
QCOMPARE(panelSpy.count(), 1);
currentRect = query.value(Qt::ImCursorRectangle).toRectF();
QCOMPARE(currentRect, previousRect);
QCOMPARE(input->cursorRectangle(), currentRect);
- QCOMPARE(cursor->pos(), currentRect.topLeft());
+ QCOMPARE(cursor->position(), currentRect.topLeft());
QCOMPARE(inputSpy.count(), 1);
QCOMPARE(panelSpy.count(), 1);
}
// Clicking on the same point inside TextInput three times in a row
// should trigger a triple click, thus selecting all the text.
- QPoint pointInside = input->pos().toPoint() + QPoint(2,2);
+ QPoint pointInside = input->position().toPoint() + QPoint(2,2);
QTest::mouseDClick(&view, Qt::LeftButton, 0, pointInside);
QTest::mouseClick(&view, Qt::LeftButton, 0, pointInside);
QGuiApplication::processEvents();
TestTouchItem *middleItem = new TestTouchItem(bottomItem);
middleItem->setObjectName("Middle Item");
- middleItem->setPos(QPointF(50, 50));
+ middleItem->setPosition(QPointF(50, 50));
middleItem->setSize(QSizeF(150, 150));
TestTouchItem *topItem = new TestTouchItem(middleItem);
topItem->setObjectName("Top Item");
- topItem->setPos(QPointF(50, 50));
+ topItem->setPosition(QPointF(50, 50));
topItem->setSize(QSizeF(150, 150));
QPointF pos(10, 10);
TestTouchItem *middleItem = new TestTouchItem(bottomItem);
middleItem->setObjectName("Middle Item");
- middleItem->setPos(QPointF(50, 50));
+ middleItem->setPosition(QPointF(50, 50));
middleItem->setSize(QSizeF(150, 150));
TestTouchItem *topItem = new TestTouchItem(middleItem);
topItem->setObjectName("Top Item");
- topItem->setPos(QPointF(50, 50));
+ topItem->setPosition(QPointF(50, 50));
topItem->setSize(QSizeF(150, 150));
QPointF pos(10, 10);
QVERIFY(QTest::qWaitForWindowExposed(window));
TestTouchItem *item = new TestTouchItem(window->contentItem());
- item->setPos(QPointF(50, 50));
+ item->setPosition(QPointF(50, 50));
item->setSize(QSizeF(150, 150));
QPointF pos(10, 10);
item->spinLoopWhenPressed = true; // will call processEvents() from the touch handler
- item->setPos(QPointF(50, 50));
+ item->setPosition(QPointF(50, 50));
item->setSize(QSizeF(150, 150));
QPointF pos(60, 60);
QTest::qWait(10);
TestTouchItem *item = new TestTouchItem(window->contentItem());
- item->setPos(QPointF(50, 50));
+ item->setPosition(QPointF(50, 50));
item->setSize(QSizeF(150, 150));
QList<QWindowSystemInterface::TouchPoint> points;
QTest::qWait(10);
TestTouchItem *item = new TestTouchItem(window->contentItem());
- item->setPos(QPointF(50, 50));
+ item->setPosition(QPointF(50, 50));
item->setSize(QSizeF(150, 150));
item->acceptTouchEvents = false;
TestTouchItem *middleItem = new TestTouchItem(bottomItem);
middleItem->setObjectName("Middle Item");
- middleItem->setPos(QPointF(50, 50));
+ middleItem->setPosition(QPointF(50, 50));
middleItem->setSize(QSizeF(150, 150));
TestTouchItem *topItem = new TestTouchItem(middleItem);
topItem->setObjectName("Top Item");
- topItem->setPos(QPointF(50, 50));
+ topItem->setPosition(QPointF(50, 50));
topItem->setSize(QSizeF(150, 150));
QPoint pos(100, 100);
window.resize(320, 240);
QQuickItem parentItem;
- parentItem.setPos(QPointF(0, 0));
+ parentItem.setPosition(QPointF(0, 0));
parentItem.setSize(QSizeF(180, 180));
parentItem.setParentItem(window.contentItem());
QQuickItem childItem;
- childItem.setPos(QPointF(60, 90));
+ childItem.setPosition(QPointF(60, 90));
childItem.setSize(QSizeF(120, 120));
childItem.setParentItem(&parentItem);
QQuickItem clippingItem;
- clippingItem.setPos(QPointF(120, 120));
+ clippingItem.setPosition(QPointF(120, 120));
clippingItem.setSize(QSizeF(180, 180));
clippingItem.setClip(true);
clippingItem.setParentItem(window.contentItem());
QQuickItem clippedItem;
- clippedItem.setPos(QPointF(-30, -30));
+ clippedItem.setPosition(QPointF(-30, -30));
clippedItem.setSize(QSizeF(120, 120));
clippedItem.setParentItem(&clippingItem);
QVERIFY(flickable->contentX() == 0.0);
QPoint p = QPoint(100, 100);
QTest::touchEvent(window, device).press(0, p, window);
- QCOMPARE(rect->pos(), QPointF(200.0, 200.0));
+ QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
QTest::touchEvent(window, device).move(0, p, window);
p -= QPoint(10, 0);
QVERIFY(flickable->contentX() == 0.0);
QPoint p = QPoint(100, 100);
QTest::touchEvent(window, device).press(0, p, window);
- QCOMPARE(rect->pos(), QPointF(200.0, 200.0));
+ QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
QTest::touchEvent(window, device).move(0, p, window);
p -= QPoint(10, 0);
QTest::qWait(1000);
//QVERIFY(flickable->isMovingHorizontally());
- qDebug() << "Pos: " << rect->pos();
+ qDebug() << "Pos: " << rect->position();
// wait until flicking is done
QTRY_VERIFY(!flickable->isFlicking());
QVERIFY(flickable->contentX() == 0.0);
QPoint p = QPoint(100, 100);
QTest::touchEvent(window, device).press(0, p, window);
- QCOMPARE(rect->pos(), QPointF(200.0, 200.0));
+ QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
QTest::touchEvent(window, device).move(0, p, window);
p -= QPoint(10, 0);
QGuiApplication::processEvents();
//QVERIFY(flickable->isMovingHorizontally());
- qDebug() << "Pos: " << rect->pos();
+ qDebug() << "Pos: " << rect->position();
// pinch
QPoint p1 = QPoint(40, 20);
flickable->setContentX(0.0);
p = QPoint(100, 100);
pinchSequence.press(0, p, window).commit();
- QCOMPARE(rect->pos(), QPointF(200.0, 200.0));
+ QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
pinchSequence.move(0, p, window).commit();
p -= QPoint(10, 0);