diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-02-05 08:48:22 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-02-05 08:48:22 (GMT) |
commit | 3baf7b981a8f40ed13c2ffb62d2188a16005f69c (patch) | |
tree | deea1cb454575b4104b58732333588d1b17bb697 /src | |
parent | 3d5aacccdb14ca428cc05e2a0db36bf3baa1a1fa (diff) | |
download | Qt-3baf7b981a8f40ed13c2ffb62d2188a16005f69c.zip Qt-3baf7b981a8f40ed13c2ffb62d2188a16005f69c.tar.gz Qt-3baf7b981a8f40ed13c2ffb62d2188a16005f69c.tar.bz2 |
fix regression from Qt 4.5 wrt missing text pixels in QTabBar
The line spacing fix showed a bug in QCommonStylePrivate::tabLayout.
Since QFontMetrics::height() now usually returns one pixel less than
in Qt 4.5, the tab bar is one pixel smaller.
Squeezing the tab rect vertically can result in missing pixels.
This depends on anti-aliasing settings and font size.
The new behaviour in tabLayout is now: If we have to shift the tab
rect, then we move its position instead of changing its height.
Task-number: QTBUG-7137
Reviewed-by: jbache
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 74d3ec3..b1924e7 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -1149,10 +1149,10 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) verticalShift = -verticalShift; - tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding); + tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding); bool selected = opt->state & QStyle::State_Selected; if (selected) { - tr.setBottom(tr.bottom() - verticalShift); + tr.setTop(tr.top() - verticalShift); tr.setRight(tr.right() - horizontalShift); } |