fix positioning

This commit is contained in:
Marco Martin 2011-10-28 20:34:46 +02:00
parent 0fa2538000
commit 77fa1ee910

View File

@ -120,8 +120,8 @@ void QMenuProxy::open()
const QRect avail = QApplication::desktop()->availableGeometry(view);
QPoint menuPos = view->mapToGlobal(view->mapFromScene(parentItem->scenePos()+QPoint(0, parentItem->boundingRect().height())));
if (menuPos.y() + m_menu->height() > avail.bottom()) {
menuPos = view->mapToGlobal(view->mapFromScene(parentItem->scenePos() - QPoint(0, m_menu->height())));
if (menuPos.y() + m_menu->sizeHint().height() > avail.bottom()) {
menuPos = view->mapToGlobal(view->mapFromScene(parentItem->scenePos() - QPoint(0, m_menu->sizeHint().height())));
}
m_menu->popup(menuPos);