assert on having a view before calling this ...

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=779305
This commit is contained in:
Aaron J. Seigo 2008-02-25 20:50:26 +00:00
parent 507a6f02a0
commit 9c6dd4846b

View File

@ -91,7 +91,7 @@ QGraphicsView *Widget::view() const
foreach (QGraphicsView *view, scene()->views()) { foreach (QGraphicsView *view, scene()->views()) {
if (view->sceneRect().intersects(sceneBoundingRect()) || if (view->sceneRect().intersects(sceneBoundingRect()) ||
view->sceneRect().contains(scenePos())) { view->sceneRect().contains(scenePos())) {
return view; return view;
} }
} }
@ -432,9 +432,12 @@ void Widget::managingLayoutChanged()
QPoint Widget::popupPosition(const QSize &s) const QPoint Widget::popupPosition(const QSize &s) const
{ {
QPoint pos = view()->mapFromScene(scenePos()); QGraphicsView *v = view();
pos = view()->mapToGlobal(pos); Q_ASSERT(v);
Plasma::View *pv = dynamic_cast<Plasma::View *>(view());
QPoint pos = v->mapFromScene(scenePos());
pos = v->mapToGlobal(pos);
Plasma::View *pv = dynamic_cast<Plasma::View *>(v);
Plasma::Location loc = Floating; Plasma::Location loc = Floating;
if (pv) { if (pv) {