Code Example for Portrait / Landscape Autorotate Layout in Qt

From Qt Wiki
Jump to navigation Jump to search

Template:ArticleMetaData


Overview[edit | edit source]

This Article gives a full Qt Creator Code Example Project for portrait/landscape autorotate layout management as described in the article How to create flexible Portrait - Landscape rotation layout in Qt

This code example can be self-signed.


Source files[edit | edit source]

Complete Source files and header files are part or the attached ZIP archive, that also includes the Qt Creator .pro file.

Postconditions[edit | edit source]

When successfully building and running this code example, the result should look like the attached screenshots show:

Portrait (Vertical) Position of the Phone (here 5800 Xpress Music)

Applying in this example case a QVBoxLayout.

File:SamplePLLayout ScreenshotPortrait.jpg

Landscape (Horizontal) Position of the Phone (here 5800 Xpress Music)

Applying in this example case a QHBoxLayout.

File:SamplePLLayout ScreenshotLandscape.jpg

Test application[edit | edit source]

Here the complete Sample Code Archive for download:

File:SamplePLLayout.zip