I can't figure this out, if I apply a stylesheet to QMenu, the spacing between the menu text, and the hotkey text does not expand to adjust for the text length, but if I use the default system menu, it works as expected.

Picture of my problem:



You can see above that there is not enough space between the text, and it does not seem to expand at all. Any help would be appreciated!

CSS Code:

Qt Code:
  1. background-color: white;
  2. }
  3.  
  4. QMenu::item {
  5. padding: 2px 20px 2px 20px;
  6. border: 1px solid transparent; /* reserve space for selection border */
  7. spacing: 20px;
  8. }
  9.  
  10.  
  11. QMenu::item:selected {
  12. border-color: darkblue;
  13. background: rgb(53, 120, 191, 150);
  14. color:white;
  15. }
  16.  
  17. QMenu::separator {
  18. height: 2px;
  19. margin: 2px 5px 2px 4px;
  20. }
  21.  
  22. QMenu::indicator {
  23. width: 20px;
  24. height: 13px;
  25. }
To copy to clipboard, switch view to plain text mode