diff options
author | Zhang Sheng <zhangsheng@uniontech.com> | 2020-11-16 11:19:17 +0800 |
---|---|---|
committer | Zhang Sheng <zhangsheng@uniontech.com> | 2020-11-16 12:53:37 +0000 |
commit | e13173c112b729da8f53dd2e81e8116a1ed857cf (patch) | |
tree | 49c2bce0c3349eebd0f2b62c80a1b7168ae45dc2 /src/widgets/styles | |
parent | 802e5a45baf3ac7da2cb3be06d10bdd69696fcae (diff) |
Adjust code format, add space after 'if'
Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 14 | ||||
-rw-r--r-- | src/widgets/styles/qstylefactory.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 14 |
5 files changed, 20 insertions, 20 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index bcddd452cd..fad02d5ae9 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1824,22 +1824,22 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, switch (tab->shape) { case QTabBar::TriangularNorth: rect.adjust(0, 0, 0, -tabOverlap); - if(!selected) + if (!selected) rect.adjust(1, 1, -1, 0); break; case QTabBar::TriangularSouth: rect.adjust(0, tabOverlap, 0, 0); - if(!selected) + if (!selected) rect.adjust(1, 0, -1, -1); break; case QTabBar::TriangularEast: rect.adjust(tabOverlap, 0, 0, 0); - if(!selected) + if (!selected) rect.adjust(0, 1, -1, -1); break; case QTabBar::TriangularWest: rect.adjust(0, 0, -tabOverlap, 0); - if(!selected) + if (!selected) rect.adjust(1, 1, 0, -1); break; default: @@ -4699,7 +4699,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid || tb->shape == QTabBar::RoundedWest || tb->shape == QTabBar::RoundedEast)) ret = 8; else - if(tb && (tb->shape == QTabBar::TriangularWest || tb->shape == QTabBar::TriangularEast)) + if (tb && (tb->shape == QTabBar::TriangularWest || tb->shape == QTabBar::TriangularEast)) ret = 3; else ret = 2; @@ -5191,7 +5191,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_FocusFrame_Mask: ret = 1; if (widget) { - if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { + if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { mask->region = widget->rect(); const int vmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameVMargin, opt); const int hmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin, opt); @@ -5205,7 +5205,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget ret = 0; if (rbOpt->shape == QRubberBand::Rectangle) { ret = true; - if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { + if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { mask->region = opt->rect; const int margin = proxy()->pixelMetric(PM_DefaultFrameWidth, opt) * 2; mask->region -= opt->rect.adjusted(margin, margin, -margin, -margin); diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp index 54a399ed39..87a8000ce0 100644 --- a/src/widgets/styles/qstylefactory.cpp +++ b/src/widgets/styles/qstylefactory.cpp @@ -109,7 +109,7 @@ QStyle *QStyleFactory::create(const QString& key) { } // Keep these here - they make the #ifdefery above work if (!ret) ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style); - if(ret) + if (ret) ret->setObjectName(style); return ret; } diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index 5b771c6fba..d8e0495b37 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -385,7 +385,7 @@ void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rec QRect(left, 0, size.width() -right - left, top)); //top-left - if(left > 0) + if (left > 0) painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap, QRect(0, 0, left, top)); diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 407134298b..a4d41566ee 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3922,7 +3922,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q ParentStyle::drawControl(ce, opt, p, w); return; } - if(hasStyleRule(w, PseudoElement_HeaderViewSection)) { + if (hasStyleRule(w, PseudoElement_HeaderViewSection)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw() || subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont || subRule.hasBorder()) { @@ -4490,7 +4490,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op Q_FALLTHROUGH(); case PE_PanelMenu: case PE_PanelStatusBar: - if(rule.hasDrawable()) { + if (rule.hasDrawable()) { rule.drawRule(p, opt->rect); return; } @@ -4891,7 +4891,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const break; case PM_ScrollView_ScrollBarSpacing: - if(!rule.hasNativeBorder() || rule.hasBox()) + if (!rule.hasNativeBorder() || rule.hasBox()) return 0; break; #endif // QT_CONFIG(scrollbar) @@ -5058,7 +5058,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_ComboBox: case CT_PushButton: if (rule.hasBox() || !rule.hasNativeBorder()) { - if(ct == CT_ComboBox) { + if (ct == CT_ComboBox) { //add some space for the drop down. QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown); QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction); diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 02188c5b29..ec252d9293 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -267,7 +267,7 @@ void QWindowsStyle::polish(QApplication *app) d->inactiveCaptionText = palette.window().color(); #if defined(Q_OS_WIN) //fetch native title bar colors - if(app->desktopSettingsAware()){ + if (app->desktopSettingsAware()){ DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION); DWORD gradientActiveCaption = GetSysColor(COLOR_GRADIENTACTIVECAPTION); DWORD inactiveCaption = GetSysColor(COLOR_INACTIVECAPTION); @@ -630,7 +630,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid ret = 0; if (rbOpt->shape == QRubberBand::Rectangle) { ret = true; - if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) { + if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) { mask->region = opt->rect; int size = 1; if (widget && widget->isWindow()) @@ -673,7 +673,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QRect rect = opt->rect; const int margin = 2; QPen oldPen = p->pen(); - if(opt->state & State_Horizontal){ + if (opt->state & State_Horizontal){ const int offset = rect.width()/2; p->setPen(QPen(opt->palette.dark().color())); p->drawLine(rect.bottomLeft().x() + offset, @@ -758,7 +758,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, if (opt->state & (State_Raised | State_Sunken | State_On)) { if (opt->state & State_AutoRaise) { - if(opt->state & (State_Enabled | State_Sunken | State_On)){ + if (opt->state & (State_Enabled | State_Sunken | State_On)){ if (panel) qDrawShadePanel(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), 1, &fill); @@ -1618,7 +1618,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai default: break; } - if(opt->direction == Qt::RightToLeft){ //reverse layout changes the order of Beginning/end + if (opt->direction == Qt::RightToLeft){ //reverse layout changes the order of Beginning/end bool tmp = paintLeftBorder; paintRightBorder=paintLeftBorder; paintLeftBorder=tmp; @@ -1733,7 +1733,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai int myHeight = pbBits.rect.height(); int chunksToDraw = chunksInRow; - if(step > chunkCount - 5)chunksToDraw = (chunkCount - step); + if (step > chunkCount - 5)chunksToDraw = (chunkCount - step); p->save(); p->setClipRect(m.mapRect(QRectF(rect)).toRect()); @@ -1747,7 +1747,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai x += reverse ? -unit_width : unit_width; } //Draw wrap-around chunks - if( step > chunkCount-5){ + if ( step > chunkCount-5){ x0 = reverse ? rect.left() + rect.width() - unit_width : rect.left() ; x = 0; int chunksToDraw = step - (chunkCount - chunksInRow); |