summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-10 23:27:10 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-10 23:27:10 +0200
commitcbe332405aa22257d432f1797b325f5e57007c20 (patch)
tree0d817dc7ed2f3a2f6035f924a824d351420910c5 /src/widgets/styles
parentd2c6294bd5cc3c2e61aaa0c83bfd74941ced150e (diff)
parent67ca72796e23269451795baf9adde02a184a7b9e (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: configure mkspecs/macx-ios-clang/features/default_pre.prf mkspecs/macx-ios-clang/features/sdk.prf mkspecs/unsupported/freebsd-g++46/qplatformdefs.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro Change-Id: Ia943555d1e59234a66f7dc65bdfda838e40001b5
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp3
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm4
-rw-r--r--src/widgets/styles/qwindowscestyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsmobilestyle.cpp13
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp3
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp3
7 files changed, 11 insertions, 23 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 0dd3610164..3a39441785 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2389,8 +2389,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
if (!titleBar->icon.isNull()) {
titleBar->icon.paint(painter, iconRect);
} else {
- QStyleOption tool(0);
- tool.palette = titleBar->palette;
+ QStyleOption tool = *titleBar;
QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16);
tool.rect = iconRect;
painter->save();
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index e51f750916..3a875f9372 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -5954,12 +5954,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
#ifndef QT_NO_ACCESSIBILITY
if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
if (tb->subControls & SC_ToolButtonMenu) {
- QStyleOption arrowOpt(0);
+ QStyleOption arrowOpt = *tb;
arrowOpt.rect = proxy()->subControlRect(cc, tb, SC_ToolButtonMenu, widget);
arrowOpt.rect.setY(arrowOpt.rect.y() + arrowOpt.rect.height() / 2);
arrowOpt.rect.setHeight(arrowOpt.rect.height() / 2);
- arrowOpt.state = tb->state;
- arrowOpt.palette = tb->palette;
proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);
} else if ((tb->features & QStyleOptionToolButton::HasMenu)
&& (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) {
diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp
index 0fb4192417..4633659963 100644
--- a/src/widgets/styles/qwindowscestyle.cpp
+++ b/src/widgets/styles/qwindowscestyle.cpp
@@ -1443,8 +1443,7 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt
if (toolbutton->activeSubControls & SC_ToolButtonMenu)
mflags |= State_Sunken;
- QStyleOption tool(0);
- tool.palette = toolbutton->palette;
+ QStyleOption tool = *toolbutton;
if (toolbutton->subControls & SC_ToolButton) {
tool.rect = button;
tool.state = bflags;
@@ -1626,9 +1625,8 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt
if (cmb->activeSubControls == SC_ComboBoxArrow)
flags |= State_Sunken;
- QStyleOption arrowOpt(0);
+ QStyleOption arrowOpt = *cmb;
arrowOpt.rect = ar;
- arrowOpt.palette = cmb->palette;
arrowOpt.state = flags;
drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget);
}
diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp
index 45323d1d15..e1609e040c 100644
--- a/src/widgets/styles/qwindowsmobilestyle.cpp
+++ b/src/widgets/styles/qwindowsmobilestyle.cpp
@@ -6111,8 +6111,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
buttonFlags |= State_Sunken;
if (toolbutton->activeSubControls & SC_ToolButtonMenu)
menuFlags |= State_On;
- QStyleOption tool(0);
- tool.palette = toolbutton->palette;
+ QStyleOption tool = *toolbutton;
if (toolbutton->subControls & SC_ToolButton) {
tool.rect = button;
tool.state = buttonFlags;
@@ -6121,14 +6120,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
if (toolbutton->subControls & SC_ToolButtonMenu) {
tool.rect = menuarea;
tool.state = buttonFlags & State_Enabled;
- QStyleOption toolMenu(0);
- toolMenu = *toolbutton;
+ QStyleOption toolMenu = *toolbutton;
toolMenu.state = menuFlags;
if (buttonFlags & State_Sunken)
proxy()->drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget);
- QStyleOption arrowOpt(0);
- arrowOpt.rect = tool.rect;
- arrowOpt.palette = tool.palette;
+ QStyleOption arrowOpt = toolMenu;
State flags = State_None;
if (menuFlags & State_Enabled)
flags |= State_Enabled;
@@ -6250,9 +6246,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
flags |= State_Enabled;
if (option->state & State_On)
flags |= State_Sunken;
- QStyleOption arrowOpt(0);
+ QStyleOption arrowOpt = *cmb;
arrowOpt.rect = ar;
- arrowOpt.palette = cmb->palette;
arrowOpt.state = flags;
proxy()->drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget);
if (cmb->subControls & SC_ComboBoxEditField) {
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index f6323bb41c..3eca9aef7f 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -2173,9 +2173,8 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
if (sunkenArrow)
flags |= State_Sunken;
- QStyleOption arrowOpt(0);
+ QStyleOption arrowOpt = *cmb;
arrowOpt.rect = ar.adjusted(1, 1, -1, -1);
- arrowOpt.palette = cmb->palette;
arrowOpt.state = flags;
proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index dce0a93e10..5c227b9d5d 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1065,7 +1065,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
QPainter imagePainter(&image);
theme.painter = &imagePainter;
theme.partId = vertical ? PP_FILLVERT : PP_FILL;
- theme.rect = QRect(QPoint(0,0), theme.rect.size());
+ theme.rect = QRect(QPoint(0,0), animRect.size());
QLinearGradient alphaGradient(0, 0, vertical ? 0 : image.width(),
vertical ? image.height() : 0);
alphaGradient.setColorAt(0, QColor(0, 0, 0, 0));
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 3f38164c01..900597cdab 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -3052,8 +3052,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
- QStyleOption tool(0);
- tool.palette = toolbutton->palette;
+ QStyleOption tool = *toolbutton;
if (toolbutton->subControls & SC_ToolButton) {
if (flags & (State_Sunken | State_On | State_Raised) || !autoRaise) {
if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup && autoRaise) {