summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp6
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp1
-rw-r--r--src/gui/styles/qmacstyle_mac.mm51
-rw-r--r--src/gui/widgets/qtabwidget.cpp8
4 files changed, 62 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 9759b39911..d1c5fd2320 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -8007,6 +8007,8 @@ QPen QAbstractGraphicsShapeItem::pen() const
void QAbstractGraphicsShapeItem::setPen(const QPen &pen)
{
Q_D(QAbstractGraphicsShapeItem);
+ if (d->pen == pen)
+ return;
prepareGeometryChange();
d->pen = pen;
d->boundingRect = QRectF();
@@ -8037,6 +8039,8 @@ QBrush QAbstractGraphicsShapeItem::brush() const
void QAbstractGraphicsShapeItem::setBrush(const QBrush &brush)
{
Q_D(QAbstractGraphicsShapeItem);
+ if (d->brush == brush)
+ return;
d->brush = brush;
update();
}
@@ -9167,6 +9171,8 @@ QPen QGraphicsLineItem::pen() const
void QGraphicsLineItem::setPen(const QPen &pen)
{
Q_D(QGraphicsLineItem);
+ if (d->pen == pen)
+ return;
prepareGeometryChange();
d->pen = pen;
update();
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 631a9cf8fa..bf57460239 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -140,6 +140,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
// no room on the current line, start new glyph strip
m_cx = 0;
m_cy += m_currentRowHeight + paddingDoubled;
+ m_cy += rowHeight;
m_currentRowHeight = 0; // New row
}
if (m_cy + c.h > m_h) {
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 074dd89731..f8fc126b89 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -5616,6 +5616,57 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
// hack to work around horrible sizeHint() code in QAbstractSpinBox
sz.setHeight(sz.height() - 3);
break;
+ case QStyle::CT_TabWidget:
+ // the size between the pane and the "contentsRect" (+4,+4)
+ // (the "contentsRect" is on the inside of the pane)
+ sz = QWindowsStyle::sizeFromContents(ct, opt, csz, widget);
+ /**
+ This is supposed to show the relationship between the tabBar and
+ the stack widget of a QTabWidget.
+ Unfortunately ascii is not a good way of representing graphics.....
+ PS: The '=' line is the painted frame.
+
+ top ---+
+ |
+ |
+ |
+ | vvv just outside the painted frame is the "pane"
+ - -|- - - - - - - - - - <-+
+ TAB BAR +=====^============ | +2 pixels
+ - - -|- - -|- - - - - - - <-+
+ | | ^ ^^^ just inside the painted frame is the "contentsRect"
+ | | |
+ | overlap |
+ | | |
+ bottom ------+ <-+ +14 pixels
+ |
+ v
+ ------------------------------ <- top of stack widget
+
+
+ To summarize:
+ * 2 is the distance between the pane and the contentsRect
+ * The 14 and the 1's are the distance from the contentsRect to the stack widget.
+ (same value as used in SE_TabWidgetTabContents)
+ * overlap is how much the pane should overlap the tab bar
+ */
+ // then add the size between the stackwidget and the "contentsRect"
+
+ if (const QStyleOptionTabWidgetFrame *twf
+ = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
+ QSize extra(0,0);
+ const int overlap = pixelMetric(PM_TabBarBaseOverlap, opt, widget);
+ const int gapBetweenTabbarAndStackWidget = 2 + 14 - overlap;
+
+ if (getTabDirection(twf->shape) == kThemeTabNorth || getTabDirection(twf->shape) == kThemeTabSouth) {
+ extra = QSize(2, gapBetweenTabbarAndStackWidget + 1);
+ } else {
+ extra = QSize(gapBetweenTabbarAndStackWidget + 1, 2);
+ }
+ sz+= extra;
+ }
+
+ break;
case QStyle::CT_TabBarTab:
if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
const QAquaWidgetSize AquaSize = d->aquaSizeConstrain(opt, widget);
diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp
index 047a905b3e..583c112093 100644
--- a/src/gui/widgets/qtabwidget.cpp
+++ b/src/gui/widgets/qtabwidget.cpp
@@ -814,8 +814,8 @@ QSize QTabWidget::sizeHint() const
{
Q_D(const QTabWidget);
QSize lc(0, 0), rc(0, 0);
- QStyleOption opt(0);
- opt.init(this);
+ QStyleOptionTabWidgetFrameV2 opt;
+ initStyleOption(&opt);
opt.state = QStyle::State_None;
if (d->leftCornerWidget)
@@ -863,8 +863,8 @@ QSize QTabWidget::minimumSizeHint() const
QSize sz = basicSize(d->pos == North || d->pos == South, lc, rc, s, t);
- QStyleOption opt(0);
- opt.rect = rect();
+ QStyleOptionTabWidgetFrameV2 opt;
+ initStyleOption(&opt);
opt.palette = palette();
opt.state = QStyle::State_None;
return style()->sizeFromContents(QStyle::CT_TabWidget, &opt, sz, this)