How to set your application display screen for Symbian Device

From Qt Wiki
Revision as of 12:25, 25 February 2015 by Maintenance script (talk | contribs)
Jump to navigation Jump to search

h1. Overview

This article describes on how you can set your application screen size.

To make your application full screen

QWidget widget;
#ifdef Q_OS_SYMBIAN
 widget.showFullscreen();
#else
 widget.show();
#endif

To make your application fit to screen size.

QWidget widget;
#ifdef Q_OS_SYMBIAN
 widget.showMaximized();
#else
 widget.show();
#endif

To override the minimum size constraint of QLayout

Qt layouts default have minimum size constraint set for the containing QWidgets which results layout to have a minimum size. If the UI control containing this layout is resized smaller than this limit, the layout just wont get smaller. In mobile resolutions this often means that the corresponding UI control won't scale small enough and the control will be partially drawn outside of the screen.

By overriding the minimum size constraint we can force the layout to scale the containing widgets as small as needed.

Note: The containing widgets might be scaled smaller than they were meant to be scaled. This can result as degraded look and feel in the used widgets.

QLayout *layout = new QVBoxLayout;
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
 layout->setSizeConstraint(QLayout::SetNoConstraint);
#endif