Frage

Is there a way to have multiple columns in a QMenu? I'm using Qt with C++. I have searched and there does not seem to be a way to do this built in to Qt. The question then is how do I add this functionality to my program? Has anyone built a custom menu that can have multiple columns?

War es hilfreich?

Lösung 2

I found a way to do this here. This is not normally something that you want to do; there is usually a better way; but in my application, the user will be greatly helped by it.

Andere Tipps

Maybe a submenu is what you're looking for. As qt doc says:

Separators are inserted with addSeparator(), submenus with addMenu(), and all other items are considered action items.

For example, here there is a full example. And "Format" menu item is a submenu. You can add a submenu with:

m_mysubmenu = QMenu(...);
...
m_menu->addMenu(m_mysubmenu);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top