2
votes

I want to create a custom Qt/QML menu like the main menu in Firefox:

Firefox menu

As you can see, the menu can exceed the boundaries of the main window if it is bigger than the main window. Is there any way to achieve such behavior in Qt? I tried with the native Menu QML component, but this only gives me a default OS context menu with very vew customization options. I want full control over how the menu looks like and its contents (i.e. the same possibilities I have for a normal QML component or widget).

1
Just create a window, and in it put what ever you want? Seems quite straightforward. - hyde
Unclear what are you asking. What is "full control"? What is "can exceed the boundaries"? Please provide example. - folibis
Usually, a Qt Component is clipped by its parent window. This is not true for the menu in Firefox (see screenshot). I want to know how to achieve this in Qt. By full control I mean that I can put into the container whatever components I want (just like I can put into a window whatever I want). When using native context menus, you are usually limited to the text for the menu entries and maybe an icon. - hg.m

1 Answers

0
votes

However, I doubt that any of these options will be sufficient in your case, as native menu support means utilising whatever the OS provides, which is probably not flexible enough to implement the menu shown in the image.

As mentioned by @hyde, one option may be to create a Window and implement your menu in there.