[PyQt] Truncated menus on Windows on first open on some PyQt versions, but not all

Marko Luther marko.luther at gmx.net
Sun Jul 7 14:06:49 BST 2019


Dear all,

we observed a strange issue where the application menus (only) on Windows got truncated on first opening after the application start in our application. It seems that the menus did not get properly initialised. We traced this down to our use of the QGraphicsDropShadowEffect for buttons on the main window.

btn.setGraphicsEffect(QtWidgets.QGraphicsDropShadowEffect)

Interestingly this issue only shows up in some versions, but not others (all installed via pip).
- menus are initially truncated on PyQt 5.12, PyQt 5.12.1, PyQt 5.12.2 and PyQt 5.13
- menus work as expected in PyQt 5.11.3 or PyQt 5.12.3

We tested this under Windows 7, 8, and 10. So the version of Windows might not be relevant.

Are we doing something wrong here, or is this a Qt/PyQt (build-)issue on some versions?
We couldn't find a corresponding Qt issue on the Qt issue tracker.

A short example script that reveals the issue is attached below as well as two screen shot from running it on PyQt 5.12.2. Note that the issue not only happens in combination with a keyboard shortcuts and comes with some variations depending on the app menu language used. On our Chinese menus, submenus are not only truncated, but also rendered with some spacing between the main menu and the submenu.

Thanks for your support,
Marko


-------------- next part --------------
A non-text attachment was scrubbed...
Name: truncatedmenu.py
Type: text/x-python-script
Size: 1102 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190707/883eefb0/attachment-0001.bin>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: first-click.png
Type: image/png
Size: 51728 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190707/883eefb0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: second-click.png
Type: image/png
Size: 43968 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190707/883eefb0/attachment-0003.png>


More information about the PyQt mailing list