[Qt-qml] Supporting landscape and portrait modes in C++/QML App

michael.brasser at nokia.com michael.brasser at nokia.com
Fri Nov 12 01:41:51 CET 2010


On 11/11/2010, at 9:56 PM, ext Paul Drummond wrote:
> 3. All the orientation-specific code in the screenorientation example
> looks like hard work to me considering that other mobile frameworks
> such as Android handle orientation automatically as long as you
> conform to the layout guidelines. Is the example the idiomatic way to
> support orientation in QML?  I guess one alternative is to have
> entirely different QML layouts for each orientation type - the
> approach I think the Flickr demo uses - is this the recommended
> approach?

This seems like a tricky question to me. From a high level, I think I'd approach it as:

(1) Figure out what I want my UI to look like in portrait, and what I want it to look like in landscape (might be very similar or wildly different; might be specific to my app or following some platform guidelines)
(2) Choose the best mechanism in QML to support (1) (might be using Qt Components; might be completely different QML files for each orientation; might be careful use of anchors and positioners)

It would certainly be nice to have an overview of the common approaches (maybe a wiki page on developer.qt.nokia.com?) to (2); I don't think we have anything like that yet.

Regards,
Michael



More information about the Qt-qml mailing list