be a little more forgiving in trying to find the Best View

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=857615
This commit is contained in:
Aaron J. Seigo 2008-09-05 20:37:15 +00:00
parent 99e664d0c5
commit fa32b0f2b6

View File

@ -440,15 +440,18 @@ QGraphicsView *Applet::view() const
}
QGraphicsView *found = 0;
QGraphicsView *possibleFind = 0;
foreach (QGraphicsView *view, scene()->views()) {
if (view->sceneRect().intersects(sceneBoundingRect()) ||
view->sceneRect().contains(scenePos())) {
if (!found || view->isActiveWindow()) {
if (view->isActiveWindow()) {
found = view;
} else {
possibleFind = view;
}
}
}
return found;
return found ? found : possibleFind;
}
QRectF Applet::mapFromView(const QGraphicsView *view, const QRect &rect) const