avoid potential infinite recursions

This commit is contained in:
Marco Martin 2012-09-21 14:23:41 +02:00
parent 18c1cc8dab
commit d86b233464

View File

@ -175,14 +175,18 @@ void QMenuProxy::open(int x, int y)
}
if (!parentItem || !parentItem->scene()) {
open(0, 0);
m_menu->popup(QPoint(0, 0));
m_status = DialogStatus::Open;
emit statusChanged();
return;
}
QList<QGraphicsView*> views = parentItem->scene()->views();
if (views.size() < 1) {
open(0, 0);
m_menu->popup(QPoint(0, 0));
m_status = DialogStatus::Open;
emit statusChanged();
return;
}
@ -233,14 +237,18 @@ void QMenuProxy::open()
}
if (!parentItem || !parentItem->scene()) {
open(0, 0);
m_menu->popup(QPoint(0, 0));
m_status = DialogStatus::Open;
emit statusChanged();
return;
}
QList<QGraphicsView*> views = parentItem->scene()->views();
if (views.size() < 1) {
open(0, 0);
m_menu->popup(QPoint(0, 0));
m_status = DialogStatus::Open;
emit statusChanged();
return;
}
@ -264,7 +272,9 @@ void QMenuProxy::open()
}
if (!view) {
open(0, 0);
m_menu->popup(QPoint(0, 0));
m_status = DialogStatus::Open;
emit statusChanged();
return;
}