Custom Qt QMenu
问题 Is there a way in Qt to add a layout or widgets to a QMenu to create a custom menu? The example below (left) is what I have, and I'd like to aim for something similar to the mock-up on the right, by adding non-menu widgets. If it can't be done by QMenu , are there guides to produce similar results (perhaps by having a more standard widget act as a context menu) anywhere? 回答1: Sure there is! In Qt, if there is a a will there is a way. You will probably need to make your own class that uses