Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.1
-
None
Description
On a multi-screen setup where the second monitor has a lower resolution than the primary screen, running the example and opening the menu on the second screen will result in an incorrect layout of the items the first time, and a correct layout of the items the second time.
#include <QApplication>
#include <QPushButton>
#include <QMenu>
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
QPushButton testButton;
QMenu menu;
for( int i = 0; i < 100; ++i )
testButton.setMenu( &menu );
testButton.show();
return app.exec();
}
QMenuPrivate::calcActionRects calls QMenuPrivate::popupGeometry with the screen number on which the QMenu is before the menu has been positioned, which usually results in the primary screen size being used.