diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-03-14 10:06:04 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-03-14 10:06:04 (GMT) |
commit | 8b7c98123eadf9263c6bde4b1263bd64fc388c8d (patch) | |
tree | 3d0d76ec09c195df92748aea376838be7c19d952 /src/gui/styles | |
parent | 3c3176f43f049e0c26e56f04881bd8047e731915 (diff) | |
download | Qt-8b7c98123eadf9263c6bde4b1263bd64fc388c8d.zip Qt-8b7c98123eadf9263c6bde4b1263bd64fc388c8d.tar.gz Qt-8b7c98123eadf9263c6bde4b1263bd64fc388c8d.tar.bz2 |
QS60Style: QTreeView::indexRowSizeHint returns incorrect value
Fix for http://bugreports.qt.nokia.com/browse/QTBUG-17786.
QS60Style tries to work around the hardcoded margin that the
QCommonStyle adds to menu items (line 4782 in my QCommonStyle.cpp).
Unfortunately regular itemview items are handled in the same code
branch in QS60Style, so the class incorrectly reduces the itemview
height 8 pixels. The reduction should only happen with menu items.
Task-number: QTBUG-17786
Reviewed-by: Laszlo Agocs
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 38a4b7c..87d990e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2643,10 +2643,13 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); //native items have small empty areas at the beginning and end of menu item sz.setWidth(sz.width() + 2 * pixelMetric(PM_MenuHMargin) + 2 * QS60StylePrivate::pixelMetric(PM_FrameCornerWidth)); - if (QS60StylePrivate::isTouchSupported()) + if (QS60StylePrivate::isTouchSupported()) { //Make itemview easier to use in touch devices + sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin)); //QCommonStyle does not adjust height with horizontal margin, it only adjusts width - sz.setHeight(sz.height() + 2 * pixelMetric(PM_FocusFrameVMargin) - 8); //QCommonstyle adds 8 to height that this style handles through PM values + if (ct == CT_MenuItem) + sz.setHeight(sz.height() - 8); //QCommonstyle adds 8 to height that this style handles through PM values + } break; #ifndef QT_NO_COMBOBOX case CT_ComboBox: { |