Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a vertical separator between icons and text in a menu

I have a question about how to add a separator between icons and text in menu. If you have any ideas, it would be really helpful. Here is exactly what I need to do:

preview.

From a button, open a menu and add separators like in the image.

like image 720
syedelec Avatar asked Sep 13 '25 15:09

syedelec


1 Answers

if you are using a QMenu() object you can use addSeparator():

menu = QMenu()
add_action = menu.addAction("Add")
menu.addSeparator()
rename_action = menu.addAction("Rename")
like image 149
Garjy Avatar answered Sep 16 '25 08:09

Garjy