summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:19:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 16:05:53 +0200
commitc2b224a758ce7e6dcf3748444fa8e29ab81904be (patch)
tree277cb99bf054190c935579142506caa4ec9861dd /src/plugins/styles
parent10de063ff12cdba07b4620182aced8ed05ee3505 (diff)
parenteaee1209f0ead5be786e81db8aee604ccfea85b0 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
Diffstat (limited to 'src/plugins/styles')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm10
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h1
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp13
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp9
4 files changed, 20 insertions, 13 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 1cd1629347..8d991cc721 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -90,7 +90,9 @@
#include <qtreeview.h>
#include <qtableview.h>
#include <qoperatingsystemversion.h>
+#if QT_CONFIG(wizard)
#include <qwizard.h>
+#endif
#include <qdebug.h>
#include <qlibrary.h>
#include <qdatetimeedit.h>
@@ -3090,7 +3092,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_FocusFrame_AboveWidget:
ret = true;
break;
-#ifndef QT_NO_WIZARD
+#if QT_CONFIG(wizard)
case SH_WizardStyle:
ret = QWizard::MacStyle;
break;
@@ -4264,6 +4266,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// outside world, unless they read the source, in which case, it's
// their own fault).
bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
+
+ if (!myTab.documentMode && (myTab.state & State_Selected) && (myTab.state & State_Active))
+ if (const auto *tabBar = qobject_cast<const QTabBar *>(w))
+ if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid())
+ myTab.palette.setColor(QPalette::WindowText, Qt::white);
+
if (verticalTabs || nonDefaultFont || !tab->icon.isNull()
|| !myTab.leftButtonSize.isEmpty() || !myTab.rightButtonSize.isEmpty()) {
int heightOffset = 0;
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 03282e1bbc..73166b12f7 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -93,7 +93,6 @@
#include <qtoolbutton.h>
#include <qtreeview.h>
#include <qtableview.h>
-#include <qwizard.h>
#include <qdebug.h>
#include <qdatetimeedit.h>
#include <qmath.h>
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index 1a1094a934..ebd3934c90 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -778,10 +778,10 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (qobject_cast<const QMessageBox *> (widget))
buttonBox = widget->findChild<const QDialogButtonBox *>(QLatin1String("qt_msgbox_buttonbox"));
-#ifndef QT_NO_INPUTDIALOG
+#if QT_CONFIG(inputdialog)
else if (qobject_cast<const QInputDialog *> (widget))
buttonBox = widget->findChild<const QDialogButtonBox *>(QLatin1String("qt_inputdlg_buttonbox"));
-#endif // QT_NO_INPUTDIALOG
+#endif // QT_CONFIG(inputdialog)
if (buttonBox) {
//draw white panel part
@@ -2151,6 +2151,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
rect = visualRect(cb->direction, cb->rect, rect);
return rect;
}
+ break;
#endif // QT_NO_COMBOBOX
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
@@ -2321,7 +2322,7 @@ void QWindowsVistaStyle::polish(QWidget *widget)
buttonBox->setContentsMargins(0, 9, 0, 0);
#endif
}
-#ifndef QT_NO_INPUTDIALOG
+#if QT_CONFIG(inputdialog)
else if (qobject_cast<QInputDialog *> (widget)) {
widget->setAttribute(Qt::WA_StyledBackground);
#if QT_CONFIG(dialogbuttonbox)
@@ -2330,7 +2331,7 @@ void QWindowsVistaStyle::polish(QWidget *widget)
buttonBox->setContentsMargins(0, 9, 0, 0);
#endif
}
-#endif // QT_NO_INPUTDIALOG
+#endif // QT_CONFIG(inputdialog)
else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)) {
tree->viewport()->setAttribute(Qt::WA_Hover);
}
@@ -2365,7 +2366,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget)
buttonBox->setContentsMargins(0, 0, 0, 0);
#endif
}
-#ifndef QT_NO_INPUTDIALOG
+#if QT_CONFIG(inputdialog)
else if (qobject_cast<QInputDialog *> (widget)) {
widget->setAttribute(Qt::WA_StyledBackground, false);
#if QT_CONFIG(dialogbuttonbox)
@@ -2374,7 +2375,7 @@ void QWindowsVistaStyle::unpolish(QWidget *widget)
buttonBox->setContentsMargins(0, 0, 0, 0);
#endif
}
-#endif // QT_NO_INPUTDIALOG
+#endif // QT_CONFIG(inputdialog)
else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)) {
tree->viewport()->setAttribute(Qt::WA_Hover, false);
} else if (qobject_cast<QCommandLinkButton*>(widget)) {
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index beb8c60e3a..a21ce4b531 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -1515,10 +1515,9 @@ case PE_Frame:
return;
} else if (fillType == BT_NONE) {
return;
- } else {
- break;
}
}
+ break;
}
case PE_FrameLineEdit: {
// we try to check if this lineedit is a delegate on a QAbstractItemView-derived class.
@@ -2434,6 +2433,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
p->restore();
return;
}
+ break;
#endif // QT_NO_RUBBERBAND
case CE_HeaderEmptyArea:
if (option->state & State_Horizontal)
@@ -3760,10 +3760,9 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
break;
#ifndef QT_NO_RUBBERBAND
case SH_RubberBand_Mask:
- if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
+ if (qstyleoption_cast<const QStyleOptionRubberBand *>(option))
res = 0;
- break;
- }
+ break;
#endif // QT_NO_RUBBERBAND
case SH_ItemView_DrawDelegateFrame: