Try calling ensurePolished() on the menu and/or the widget before you try to display the menu. Maybe this will be enough.