Hey,

I've a problem:

Every time, my "main"-item hits another, my QGraphicsView should "scroll" to / center on my main-item: (y-coord)

Qt Code:
  1. if(!scene()->collidingItems(this).isEmpty())
  2. {
  3. emit newKollision(positiony);
  4. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. VerticalScrollBar = this->verticalScrollBar();
  2. QObject::connect(mouse, SIGNAL(newKollision(int)), this, SLOT(ScrollBarSetValue(int)));
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void GraphWidget::ScrollBarSetValue(int value)
  2. {
  3. VerticalScrollBar->setValue(value-400);
  4. }
To copy to clipboard, switch view to plain text mode 
VerticalScrollBar->scroll(...., ...) doesn't work -> there appears a gray background, when I call this function.

This works well, but there is no smooth scrolling to the y-position of the item, of course...

So, has anybody an idea, how to implement smooth scrolling on a QGraphicsView, if I want to set my y-value in the application (no MouseEvent)

Thanks