https://doc.qt.io/qt-5/qml-qtquick-controls2-menubar.html
MenuBar is supported in ApplicationWindow and not in Window.
Following throws an error "Invalid property name: MenuBar"
Window
{
visible: true
width: 280; height: 280
menuBar: MenuBar {
Menu {}
}
}
whereas following works:
ApplicationWindow
{
visible: true
width: 280; height: 280
menuBar: MenuBar {
Menu {}
}
}
In the new Qt version 5.12, the default code uses Window and not ApplicationWindow.
What is the difference between Window and ApplicationWindow? Which one should be used in which case?
Windowis a basic QML type. It is just that - a window.ApplicationWindowis part of QtQuick Controls 2 and has similar functionality asQMainWindow. Which one to use is up to you. If you need a simple window, useWindow. If you need the extended functionality, useApplicationWindow. - scopchanov