[Interest] RFC: menu sections (QMenu::addSection), what would you expect from them?

René J.V. Bertin rjvbertin at gmail.com
Wed Mar 29 19:11:32 CEST 2017


Hi,

I'm curious to know what Qt users would expect from menu sections provided by QMenu::addSection() if they didn't know that those use "texted separators" which aren't supported on all platforms and by all styles.

I myself have a different idea of a "section" than I have of something created by `QMenu::addSeparator().setText("foo")`. The former is something that should show the text defined for it, while the latter is foremost a separator that might indeed not show its text. Lack of guaranteed support on the main desktop platforms makes QMenu::addSection() lose all raison d'être for me.

I've reused (not reopened) an old ticket to expose my current ideas and show some examples of what menu sections could look like on Mac even when using exclusively native APIs (= in the native menubar).

https://bugreports.qt.io/browse/QTBUG-45994?focusedCommentId=351935
https://bugreports.qt.io/secure/attachment/62817/nativemenubar-menus-sections-macstyle.png
https://bugreports.qt.io/secure/attachment/62818/nonnativemenubar-menus-sections-macstyle.png

Does that look so weird it's beyond hope for improvement or does this look like something you'd recognise and use as a way to organise a menu in named sections?

I can provide the patch (against 5.8.0) to anyone who'd like to try it out.

Thanks,
René



More information about the Interest mailing list