summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-03-26 09:00:06 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-03-26 09:08:05 (GMT)
commit3b289ff76933c08ef51eefbd07839794e26ff2fa (patch)
tree52d89e67e7efb77b27f5b4644093d8b316aa4d79 /src
parent312c0d24443a5703fbb747911e039525e8567bbb (diff)
downloadQt-3b289ff76933c08ef51eefbd07839794e26ff2fa.zip
Qt-3b289ff76933c08ef51eefbd07839794e26ff2fa.tar.gz
Qt-3b289ff76933c08ef51eefbd07839794e26ff2fa.tar.bz2
Fix regression where QMacStyle would only draw tabs w/QStyleOptionTabV3.
This is a good example of how to not use QStyleOption when added new features. It's important to start with the most compatible and then cast to the more specific versions to get the new fields. Task-number: 248769 Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qmacstyle_mac.mm17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index a3f5cfe..d598807 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3854,13 +3854,16 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
break;
case CE_TabBarTabShape:
- if (const QStyleOptionTabV3 *tabOpt = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
- if (tabOpt->documentMode) {
- p->save();
- QRect tabRect = tabOpt->rect;
- drawTabShape(p, tabOpt);
- p->restore();
- return;
+ if (const QStyleOptionTab *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+
+ if (const QStyleOptionTabV3 *tabOptV3 = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
+ if (tabOptV3->documentMode) {
+ p->save();
+ QRect tabRect = tabOptV3->rect;
+ drawTabShape(p, tabOptV3);
+ p->restore();
+ return;
+ }
}
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)