QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.engine()->rootContext()->setContextProperty("myData", &myDataObject); viewer.showExpanded(); //This line shows the window in an expanded mode on launch
QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.engine()->rootContext()->setContextProperty("myData", &myDataObject); viewer.show(); viewer.showExpanded(false); //This line disables the expanded mode behaviorIn this example, the viewer is initialized, and the show method is called to show the window. Then, the showExpanded method is called with false as an argument to disable the expanding behavior of the window. In both examples, the QmlApplicationViewer class is used, which is part of the Qt library.