equal
deleted
inserted
replaced
865 |
865 |
866 if (!menu->isVisible()) { |
866 if (!menu->isVisible()) { |
867 if ((menu->windowFlags() & Qt::Popup) != Qt::Popup) |
867 if ((menu->windowFlags() & Qt::Popup) != Qt::Popup) |
868 menu->setWindowFlags(Qt::Popup); |
868 menu->setWindowFlags(Qt::Popup); |
869 menu->adjustSize(); |
869 menu->adjustSize(); |
870 menu->move(mapToGlobal(g.bottomLeft())); |
870 if (layoutDirection() == Qt::LeftToRight) { |
|
871 menu->move(mapToGlobal(g.bottomLeft())); |
|
872 } else { |
|
873 // The position is not initially correct due to the unknown width, |
|
874 // causing it to overlap a bit the first time it is invoked. |
|
875 const QSize menuSize = menu->size(); |
|
876 QPoint point = g.bottomRight() - QPoint(menu->width(), 0); |
|
877 menu->move(mapToGlobal(point)); |
|
878 } |
871 menu->setFocus(Qt::MouseFocusReason); |
879 menu->setFocus(Qt::MouseFocusReason); |
872 menu->raise(); |
880 menu->raise(); |
873 menu->show(); |
881 menu->show(); |
874 } else { |
882 } else { |
875 menu->raise(); |
883 menu->raise(); |