Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

OpenGL and MenuBar height



  • I added the MenuBar to the application which uses OpenGL. Unfortunately it doesn't look as I expect:
    alt text
    The height of the elements is too big. I have similar problem if I add the menu to the Scene Graph - OpenGL Under QML example - https://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html to the qml file

        MenuBar {
            Menu {
                title: qsTr("&File")
                MenuItem {
                    text: qsTr("E&xit")
                }
            }
            Menu {
                title: qsTr("&Edit")
            }
            Menu {
                title: qsTr("&Help")
                MenuItem {
                    text: qsTr("About...")
                }
            }
        }
    

    Of course I can set the height of the MenuItem manually but it doesn't work correctly for MenuBar (only the background has smaller size) and I think it's not the good approach.

    Other examples without OpenGL handling but with MenuBar usage in qml have normal height. Also it doesn't have separate styles or size adjustments - for example Qt Quick Controls - UI Forms - https://doc-snapshots.qt.io/qt5-5.11/qtquickcontrols-uiforms-example.html


Log in to reply