Replace deprecated QGraphicsScene::itemAt() with items()

Change-Id: I33ee03db775d3cf6807372e0963748cf6a4e07db
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
This commit is contained in:
Thiago Macieira 2012-06-08 17:08:52 +02:00 committed by Qt by Nokia
parent 5e6b167fea
commit 693468a54d

View File

@ -53,7 +53,8 @@ void DiagramScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
QPointF mousePos(event->buttonDownScenePos(Qt::LeftButton).x(),
event->buttonDownScenePos(Qt::LeftButton).y());
movingItem = itemAt(mousePos.x(), mousePos.y());
const QList<QGraphicsItem *> itemList = items(mousePos);
movingItem = itemList.isEmpty() ? 0 : itemList.first();
if (movingItem != 0 && event->button() == Qt::LeftButton) {
oldPos = movingItem->pos();