QtWidgets: convert remaining users of QSize::transpose() to transposed()

...because transposed() is inline (and transpose() is not).

This is such a simple transformation (basically, a register rename)
that it should be inlined, even a the expense of another assignment.
(the expense being in the source, not the executable code, of course).

Change-Id: I4e5a574e899a84444de8042d305f34f5a6045a3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-12-17 16:21:03 +01:00
parent 3f893e6fd9
commit 982de3eccc
4 changed files with 11 additions and 11 deletions

View File

@ -2910,7 +2910,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
opt, widget).actualSize(QSize(iconSize, iconSize));
sz += QSize(buttonMargin, buttonMargin);
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
closeRect = QRect(right - sz.width(),
rect.center().y() - sz.height()/2,
sz.width(), sz.height());
@ -2927,7 +2927,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
opt, widget).actualSize(QSize(iconSize, iconSize));
sz += QSize(buttonMargin, buttonMargin);
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
floatRect = QRect(right - sz.width(),
rect.center().y() - sz.height()/2,
sz.width(), sz.height());
@ -2947,7 +2947,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
&& icon.cacheKey() != QApplication::windowIcon().cacheKey()) {
QSize sz = icon.actualSize(QSize(r.height(), r.height()));
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
iconRect = QRect(left, rect.center().y() - sz.height()/2,
sz.width(), sz.height());
left = iconRect.right() + margin;

View File

@ -5207,7 +5207,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
opt, widget).actualSize(QSize(iconSize, iconSize));
sz += QSize(buttonMargin, buttonMargin);
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
closeRect = QRect(left,
srect.center().y() - sz.height()/2,
sz.width(), sz.height());
@ -5224,7 +5224,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
opt, widget).actualSize(QSize(iconSize, iconSize));
sz += QSize(buttonMargin, buttonMargin);
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
floatRect = QRect(left,
srect.center().y() - sz.height()/2,
sz.width(), sz.height());
@ -5244,7 +5244,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
&& icon.cacheKey() != QApplication::windowIcon().cacheKey()) {
QSize sz = icon.actualSize(QSize(rect.height(), rect.height()));
if (verticalTitleBar)
sz.transpose();
sz = sz.transposed();
iconRect = QRect(right - sz.width(), srect.center().y() - sz.height()/2,
sz.width(), sz.height());
right = iconRect.left() - 1;
@ -6625,7 +6625,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
ThemeTabDirection ttd = getTabDirection(tab->shape);
bool vertTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
if (vertTabs)
sz.transpose();
sz = sz.transposed();
int defaultTabHeight;
int defaultExtraSpace = proxy()->pixelMetric(PM_TabBarTabHSpace, tab, widget); // Remove spurious gcc warning (AFAIK)
QFontMetrics fm = opt->fontMetrics;
@ -6655,7 +6655,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
if (vertTabs)
sz.transpose();
sz = sz.transposed();
int maxWidgetHeight = qMax(tab->leftButtonSize.height(), tab->rightButtonSize.height());
int maxWidgetWidth = qMax(tab->leftButtonSize.width(), tab->rightButtonSize.width());

View File

@ -1261,8 +1261,8 @@ bool QMainWindowTabBar::event(QEvent *e)
QSize size = this->size();
QSize hint = sizeHint();
if (shape() == QTabBar::RoundedWest || shape() == QTabBar::RoundedEast) {
size.transpose();
hint.transpose();
size = size.transposed();
hint = hint.transposed();
}
if (size.width() < hint.width())
return QTabBar::event(e);

View File

@ -426,7 +426,7 @@ QSize QProgressBar::sizeHint() const
int cw = style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &opt, this);
QSize size = QSize(qMax(9, cw) * 7 + fm.width(QLatin1Char('0')) * 4, fm.height() + 8);
if (opt.orientation == Qt::Vertical)
size.transpose();
size = size.transposed();
return style()->sizeFromContents(QStyle::CT_ProgressBar, &opt, size, this);
}