'How to add padding to Qt Menu Items for Width?

Basically I am using Qt Menu by adding actions with Shortcuts. They look fine when the menu shows up.

But I want to add more spacing between the action item text and its shortcut. Is this possible? I couldn't find any function to do this.

setMinimumWidth works but I need add on top of the dynamic width computed by Qt.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source