QtWidgets: use new QRect::transposed()
Change-Id: Idfed0ae6b80e301fd32206b2e6d68054460b76de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
8ce34c2e81
commit
26dca142a7
@ -242,8 +242,7 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option,
|
||||
QRect rect = docker->rect;
|
||||
QRect titleRect = rect;
|
||||
if (docker->verticalTitleBar) {
|
||||
QRect r = rect;
|
||||
r.setSize(r.size().transposed());
|
||||
QRect r = rect.transposed();
|
||||
|
||||
titleRect = QRect(r.left() + rect.bottom()
|
||||
- titleRect.bottom(),
|
||||
|
@ -2036,7 +2036,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
||||
const bool verticalTitleBar = dwOpt->verticalTitleBar;
|
||||
|
||||
if (verticalTitleBar) {
|
||||
r.setSize(r.size().transposed());
|
||||
r = r.transposed();
|
||||
|
||||
p->save();
|
||||
p->translate(r.left(), r.top() + r.width());
|
||||
@ -2924,7 +2924,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
||||
// horizontal, then transpose again.
|
||||
|
||||
if (verticalTitleBar)
|
||||
rect.setSize(rect.size().transposed());
|
||||
rect = rect.transposed();
|
||||
|
||||
do {
|
||||
|
||||
|
@ -1225,8 +1225,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
||||
QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget);
|
||||
if (verticalTitleBar) {
|
||||
QRect rect = dwOpt->rect;
|
||||
QRect r = rect;
|
||||
r.setSize(r.size().transposed());
|
||||
QRect r = rect.transposed();
|
||||
titleRect = QRect(r.left() + rect.bottom()
|
||||
- titleRect.bottom(),
|
||||
r.top() + titleRect.left() - rect.left(),
|
||||
|
@ -4342,8 +4342,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
||||
QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, opt, w);
|
||||
if (verticalTitleBar) {
|
||||
QRect rect = dwOpt->rect;
|
||||
QRect r = rect;
|
||||
r.setSize(r.size().transposed());
|
||||
QRect r = rect.transposed();
|
||||
|
||||
titleRect = QRect(r.left() + rect.bottom()
|
||||
- titleRect.bottom(),
|
||||
@ -5167,7 +5166,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
||||
// If this is a vertical titlebar, we transpose and work as if it was
|
||||
// horizontal, then transpose again.
|
||||
if (verticalTitleBar)
|
||||
srect.setSize(srect.size().transposed());
|
||||
srect = srect.transposed();
|
||||
|
||||
do {
|
||||
int right = srect.right();
|
||||
|
@ -4130,7 +4130,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
||||
if (!dwOpt->title.isEmpty()) {
|
||||
QRect r = subElementRect(SE_DockWidgetTitleBarText, opt, w);
|
||||
if (dwOpt->verticalTitleBar) {
|
||||
r.setSize(r.size().transposed());
|
||||
r = r.transposed();
|
||||
p->save();
|
||||
p->translate(r.left(), r.top() + r.width());
|
||||
p->rotate(-90);
|
||||
|
@ -5690,7 +5690,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption
|
||||
QRect r = rect;
|
||||
|
||||
if (verticalTitleBar) {
|
||||
r.setSize(r.size().transposed());
|
||||
r = r.transposed();
|
||||
|
||||
painter->save();
|
||||
painter->translate(r.left(), r.top() + r.width());
|
||||
|
@ -1779,7 +1779,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
||||
QRect r = rect;
|
||||
|
||||
if (verticalTitleBar) {
|
||||
r.setSize(r.size().transposed());
|
||||
r = r.transposed();
|
||||
|
||||
p->save();
|
||||
p->translate(r.left(), r.top() + r.width());
|
||||
|
@ -1383,7 +1383,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
|
||||
const bool verticalTitleBar = dwOpt->verticalTitleBar;
|
||||
|
||||
if (verticalTitleBar) {
|
||||
rect.setSize(rect.size().transposed());
|
||||
rect = rect.transposed();
|
||||
|
||||
painter->translate(rect.left() - 1, rect.top() + rect.width());
|
||||
painter->rotate(-90);
|
||||
|
@ -2383,7 +2383,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
|
||||
const bool verticalTitleBar = dwOpt->verticalTitleBar;
|
||||
|
||||
if (verticalTitleBar) {
|
||||
rect.setSize(rect.size().transposed());
|
||||
rect = rect.transposed();
|
||||
|
||||
p->translate(rect.left() - 1, rect.top() + rect.width());
|
||||
p->rotate(-90);
|
||||
|
Loading…
x
Reference in New Issue
Block a user