Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QGraphicsItem::setPos ( const QPointF pos  )  [inherited]

Sets the position of the item to pos, which is in parent coordinates. For items with no parent, pos is in scene coordinates.

The position of the item describes its origin (local coordinate (0, 0)) in parent coordinates.

See also:
pos(), scenePos(), {The Graphics View Coordinate System}

Definition at line 2151 of file qgraphicsitem.cpp.

References QGraphicsItem::prepareGeometryChange(), and QVariant::toPointF().

Referenced by View::addItems(), QGraphicsItemGroup::addToGroup(), DiagramScene::mousePressEvent(), AddCommand::redo(), MoveCommand::redo(), QGraphicsItemGroup::removeFromGroup(), MainWindow::resizeEvent(), QGraphicsWidget::setGeometry(), Mouse::timerEvent(), MoveCommand::undo(), and View::View().

{
    if(d_ptr->pos == pos)
        return;

    // Notify the item that the position is changing.
    QPointF newPos = itemChange(ItemPositionChange, pos).toPointF();
    if (newPos == d_ptr->pos)
        return;

    // Update and repositition.
    if (d_ptr->scene) {
        d_ptr->fullUpdateHelper();
        prepareGeometryChange();
    }
    d_ptr->pos = newPos;
    if (d_ptr->scene)
        d_ptr->fullUpdateHelper();

    // Send post-notification.
    itemChange(ItemPositionHasChanged, newPos);
}


Generated by  Doxygen 1.6.0   Back to index