If a widget doesn't have a size yet, it's bounding rect won't intersect
anything, so also check if its position lies within a view's scene rect. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=754627
This commit is contained in:
parent
c268168eab
commit
b907728254
@ -90,8 +90,10 @@ QGraphicsView *Widget::view() const
|
||||
if (!scene()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach (QGraphicsView *view, scene()->views()) {
|
||||
if (view->sceneRect().intersects(sceneBoundingRect())) {
|
||||
if (view->sceneRect().intersects(sceneBoundingRect()) ||
|
||||
view->sceneRect().contains(scenePos())) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user