diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-11-17 12:22:11 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-11-17 12:22:11 (GMT) |
commit | 4c7d869bc103de36b5a97dd50f323f7af680656e (patch) | |
tree | 4a97b51a7678ad0fd220ae47d97d6ed1e806ad4f /src/gui/widgets/qtabbar.cpp | |
parent | 5c4fce677e58b17fdc7ee19803b9939f56530b06 (diff) | |
download | Qt-4c7d869bc103de36b5a97dd50f323f7af680656e.zip Qt-4c7d869bc103de36b5a97dd50f323f7af680656e.tar.gz Qt-4c7d869bc103de36b5a97dd50f323f7af680656e.tar.bz2 |
Fix for tabwidget elidemode being overriden by stylesheet
Setting a stylesheet or reparenting a widget into a
widget using style sheet would cause the elidemode
to be reset. Instead we now keep the elidemode whenever
it has been explicitly set by the user rather than
querying from the style again.
Task-number: QT-1914
Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/widgets/qtabbar.cpp')
-rw-r--r-- | src/gui/widgets/qtabbar.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 3935c55..98c69c0 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1947,7 +1947,8 @@ void QTabBar::changeEvent(QEvent *event) { Q_D(QTabBar); if (event->type() == QEvent::StyleChange) { - d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); + if (!d->elideModeSetByUser) + d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this); d->refresh(); } else if (event->type() == QEvent::FontChange) { @@ -1979,6 +1980,7 @@ void QTabBar::setElideMode(Qt::TextElideMode mode) { Q_D(QTabBar); d->elideMode = mode; + d->elideModeSetByUser = true; d->refresh(); } |