How to set your application display screen for Symbian Device

From Qt Wiki
Jump to navigation Jump to search
IMPORTANT: The content of this page is outdated. Reason: The Symbian platform is no longer supported.
If you have checked or updated this page and found the content to be suitable, please remove this notice.
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

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