Search code examples
qtqmlorientationapplicationwindow

How to rotate/change the orientation of ApplicationWindow QML?


I would like to by default set my app at 180 degree orientation. What is the API to rotate the screen at ApplicationWindow level? I have toolbars and statusbars in my app, so I need to rotate the ApplicationWindow itself.


Solution

  • You can use a Page component as main component in your ApplicationWindow

    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        Page{
            rotation: 180
            anchors.fill: parent
    
            footer: ToolBar{ ... }
        }
    }
    

    Result: attached image