QMenu’s paintEvent calls a private method (QMenuPrivate::updateActionRects()) that itself calls another private method (QMenuPrivate::popupGeometry()) that relies on QDesktopWidget::availableGeometry(…). The fact that those methods are private makes it rather complicated to override to fix the calculation of the available geometry.
The best solution, that would fix the issue across the whole project, would probably be to re-implement availableGeometry(…) itself by subclassing QDesktopWidget, but then Qt internally retrieves the desktop widget by calling QApplication::desktop(), so we need to override this one too, which I really don’t know how to achieve.
QMenu’s paintEvent calls a private method (QMenuPrivate: :updateActionRe cts()) that itself calls another private method (QMenuPrivate: :popupGeometry( )) that relies on QDesktopWidget: :availableGeome try(…). The fact that those methods are private makes it rather complicated to override to fix the calculation of the available geometry.
The best solution, that would fix the issue across the whole project, would probably be to re-implement availableGeomet ry(…) itself by subclassing QDesktopWidget, but then Qt internally retrieves the desktop widget by calling QApplication: :desktop( ), so we need to override this one too, which I really don’t know how to achieve.
I filed http:// bugreports. qt.nokia. com/browse/ QTBUG-18380 to track the issue in Qt, thanks bp for the ASCII art which I shamelessly copied to explain the monitors setup there.