summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-06 09:32:13 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-04-06 09:32:13 +0200
commit1a464f35d19fbf6a5cbe93b2a2d52f2f44465913 (patch)
tree7306fbbb50429d66cf4d3d08e60e7310431b9f85 /src/widgets
parent061fbceb777c41b23bc2b8180b2af85d9b35b246 (diff)
parentb6f7230cda02d9b11b309816ca1e41dbd2716fe0 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp9
-rw-r--r--src/widgets/widgets/qtabbar.cpp6
3 files changed, 10 insertions, 7 deletions
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 5c4fc20687..52640daf55 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -839,7 +839,7 @@ int QWidgetItemV2::heightForWidth(int width) const
const QSize &size = q_cachedHfws[offset % HfwCacheMaxSize];
if (size.width() == width) {
if (q_hfwCacheSize == HfwCacheMaxSize)
- q_firstCachedHfw = offset;
+ q_firstCachedHfw = offset % HfwCacheMaxSize;
return size.height();
}
}
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index c5ccfac109..d2cbd9d456 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -611,12 +611,11 @@ void QAbstractSpinBox::stepDown()
}
/*!
Virtual function that is called whenever the user triggers a step.
- The \a steps parameter indicates how many steps were taken, e.g.
- Pressing Qt::Key_Down will trigger a call to stepBy(-1),
- whereas pressing Qt::Key_Prior will trigger a call to
- stepBy(10).
+ The \a steps parameter indicates how many steps were taken.
+ For example, pressing \c Qt::Key_Down will trigger a call to \c stepBy(-1),
+ whereas pressing \c Qt::Key_PageUp will trigger a call to \c stepBy(10).
- If you subclass QAbstractSpinBox you must reimplement this
+ If you subclass \c QAbstractSpinBox you must reimplement this
function. Note that this function is called even if the resulting
value will be outside the bounds of minimum and maximum. It's this
function's job to handle these situations.
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 9df1a4823a..3e26b04327 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -2166,8 +2166,12 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event)
QStyleOptionTabBarBase optTabBase;
optTabBase.initFrom(this);
optTabBase.documentMode = d->documentMode;
- if (style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this) == QEvent::MouseButtonRelease)
+ const bool selectOnRelease =
+ (style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this) == QEvent::MouseButtonRelease);
+ if (selectOnRelease)
setCurrentIndex(i);
+ if (!selectOnRelease || !d->validIndex(i) || d->currentIndex == i)
+ repaint(tabRect(i));
}
/*!\reimp