Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an slider bar into QMenu?

Tags:

qt

My context menu have so many items that i need a slider bar to control it, but i did't find any function could do this. How could i do?

like image 263
user720037 Avatar asked Jan 20 '23 22:01

user720037


1 Answers

From another thread on Stack Overflow, I found this trick:

submenu->setStyleSheet("QMenu { menu-scrollable: 1; }");

For further information, see create a scrollbar in a submenu qt?

@Frank Osterfeld: I have a perfect example of a valid use case for huge contextual menu that needs a scrollbar, Qt Creator and the auto-completion list.

like image 198
Emma Michelet Avatar answered Jan 31 '23 01:01

Emma Michelet