On 4 Dec 2025, at 16:12, Nuno Santos via Interest <[email protected]> 
wrote:

Hi,

I’m trying to uniformize the use of MenuBar since nowadays it is present in 
QtQuickControls and is not an experimental feature anymore.

However, on Windows it behaves very differently. When using the labs.platform 
version, the MenuBar really looks like a menu bar, the very same height and 
look and feel encountered on QtCreator itself.

However, if I use the QtQuickControls version, it gets higher in height, and 
the menu items have rounded corners.

Hi!

As documented here 
https://doc.qt.io/qt-6/qml-qtquick-controls-menubar.html#native-menu-bars , a 
true native menu bar is only applied on macOS if using the MenuBar in Qt Quick 
Controls (as opposed to the version in labs, as you point out). The reason is 
that the labs implementation is old (based on win32 APIs), and doesn’t look 
very native anymore compared to e.g Outlook, Notepad, Paint etc. Newer Windows 
apps use slightly taller menu bars with more rounded buttons, which is why the 
MenuBar in Qt Quick Controls is styled to match this more contemporary look.

And the worst of all, it does not get into scene properly if the root element 
is not a window. In my case I have a root basic root element that is loaded by 
a QQuickView.

You cannot expect a MenuBar to be placed correctly inside the window unless 
assigned to ApplicationWindow.menuBar. Is this a regression, did it used to 
work before (not thinking about the labs MenuBar)? If so, please file a bug 
report so we can take a look at it.

Is this a known limitation of the MenuBar that was integrated into 
QtQuick.Controls?

The limitation is that we currently don’t offer a true native menu bar on other 
platforms than macOS, unless you use the version in labs.

It feels that I will need to keep use of the labs.platform version on windows 
and the other one for macOS and iOS? I really don’t like to have this kind of 
exceptions because this is the primary goal of Qt.

The labs version will remain available for the foreseeable future, so if it 
works well for your use case, you can safely continue using it.

BR,
Richard Moe Gustavsen
Principal Engineer
The Qt Company

_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest

Reply via email to