summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2009-11-17 15:45:08 (GMT)
committerAlessandro Portale <alessandro.portale@nokia.com>2009-11-17 17:35:43 (GMT)
commit330d0bb75af1ffc534015d63af3dcd81ca971ce1 (patch)
treee3d88c964de4452006d2608354860cae995985c3 /src
parentfb5361e27e2c48d52c2fe26fc48f8ef1438755f5 (diff)
downloadQt-330d0bb75af1ffc534015d63af3dcd81ca971ce1.zip
Qt-330d0bb75af1ffc534015d63af3dcd81ca971ce1.tar.gz
Qt-330d0bb75af1ffc534015d63af3dcd81ca971ce1.tar.bz2
QS60Style returns hint QFormLayout::WrapLongRows
To get a mobile friendly 1-column layout, we can set QFormLayout's rowWrapPolicy. S60Style should return QFormLayout::WrapLongRows as the SH_FormLayoutWrapPolicy styleHint. Reviewed-by: Jason Barron
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qformlayout.cpp9
-rw-r--r--src/gui/styles/qs60style.cpp4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index 3e5dadc..33f5489 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -1124,14 +1124,15 @@ QStyle* QFormLayoutPrivate::getStyle() const
\value DontWrapRows
Fields are always laid out next to their label. This is
- the default policy for all styles except Qt Extended styles.
+ the default policy for all styles except Qt Extended styles
+ and QS60Style.
\value WrapLongRows
Labels are given enough horizontal space to fit the widest label,
and the rest of the space is given to the fields. If the minimum
size of a field pair is wider than the available space, the field
is wrapped to the next line. This is the default policy for
- Qt Extended styles.
+ Qt Extended styles and and QS60Style.
\value WrapAllRows
Fields are always laid out below their label.
@@ -1720,8 +1721,8 @@ QFormLayout::FieldGrowthPolicy QFormLayout::fieldGrowthPolicy() const
\brief the way in which the form's rows wrap
The default value depends on the widget or application style. For
- Qt Extended styles, the default is WrapLongRows; for the other styles,
- the default is DontWrapRows.
+ Qt Extended styles and QS60Style, the default is WrapLongRows;
+ for the other styles, the default is DontWrapRows.
If you want to display each label above its associated field
(instead of next to it), set this property to WrapAllRows.
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 467cc84..b5c0d4f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -67,6 +67,7 @@
#include "qtoolbar.h"
#include "qtoolbutton.h"
#include "qfocusframe.h"
+#include "qformlayout.h"
#include "private/qtoolbarextension_p.h"
#include "private/qcombobox_p.h"
@@ -2401,6 +2402,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_RequestSoftwareInputPanel:
retValue = RSIP_OnMouseClickAndAlreadyFocused;
break;
+ case SH_FormLayoutWrapPolicy:
+ retValue = QFormLayout::WrapLongRows;
+ break;
default:
break;
}