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/kernel | |
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/kernel')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 18 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index d4f6672eba..97753b6af4 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -421,7 +421,7 @@ void QApplicationPrivate::process_cmdline() } } - if(j < argc) { + if (j < argc) { argv[j] = nullptr; argc = j; } @@ -1512,7 +1512,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) QWidget *prev = focus_widget; focus_widget = focus; - if(focus_widget) + if (focus_widget) focus_widget->d_func()->setFocus_sys(); if (reason != Qt::NoFocusReason) { @@ -1531,7 +1531,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) if (that) QCoreApplication::sendEvent(that->style(), &out); } - if(focus && QApplicationPrivate::focus_widget == focus) { + if (focus && QApplicationPrivate::focus_widget == focus) { QFocusEvent in(QEvent::FocusIn, reason); QPointer<QWidget> that = focus; QCoreApplication::sendEvent(focus, &in); diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 5137b7ef07..b725485948 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -481,7 +481,7 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original) void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture) { QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture); - if(!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed + if (!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed return; m_deletedRecognizers.remove(gesture); if (m_deletedRecognizers.keys(recognizer).isEmpty()) { diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index 6dce2da969..db7aa1aaeb 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -744,7 +744,7 @@ bool QLayout::adoptLayout(QLayout *layout) static bool layoutDebug() { static int checked_env = -1; - if(checked_env == -1) + if (checked_env == -1) checked_env = !!qEnvironmentVariableIntValue("QT_LAYOUT_DEBUG"); return checked_env; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 4cc24499fc..e0afbb938a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1559,7 +1559,7 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier mapper->insert(data.winid, q); } - if(oldWinId != id) { + if (oldWinId != id) { QEvent e(QEvent::WinIdChange); QCoreApplication::sendEvent(q, &e); } @@ -1906,8 +1906,8 @@ QRegion QWidgetPrivate::clipRegion() const while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo)) ; for ( ; i < w->d_func()->children.size(); ++i) { - if(QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) { - if(sibling->isVisible() && !sibling->isWindow()) { + if (QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) { + if (sibling->isVisible() && !sibling->isWindow()) { QRect siblingRect(ox+sibling->x(), oy+sibling->y(), sibling->width(), sibling->height()); if (qRectIntersects(siblingRect, q->rect())) @@ -3119,7 +3119,7 @@ void QWidget::insertAction(QAction *before, QAction *action) } Q_D(QWidget); - if(d->actions.contains(action)) + if (d->actions.contains(action)) removeAction(action); int pos = d->actions.indexOf(before); @@ -6680,7 +6680,7 @@ QWidget *QWidget::previousInFocusChain() const bool QWidget::isActiveWindow() const { QWidget *tlw = window(); - if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) + if (tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup))) return true; #if QT_CONFIG(graphicsview) @@ -6691,7 +6691,7 @@ bool QWidget::isActiveWindow() const #endif if (style()->styleHint(QStyle::SH_Widget_ShareActivation, nullptr, this)) { - if(tlw->windowType() == Qt::Tool && + if (tlw->windowType() == Qt::Tool && !tlw->isModal() && (!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow())) return true; @@ -6699,7 +6699,7 @@ bool QWidget::isActiveWindow() const while(w && tlw->windowType() == Qt::Tool && !w->isModal() && w->parentWidget()) { w = w->parentWidget()->window(); - if(w == tlw) + if (w == tlw) return true; } } @@ -6842,7 +6842,7 @@ void QWidgetPrivate::reparentFocusWidgets(QWidget * oldtlw) if (oldtlw == q->window()) return; // nothing to do - if(focus_child) + if (focus_child) focus_child->clearFocus(); // separate the focus chain into new (children of myself) and old (the rest) @@ -9879,7 +9879,7 @@ void QWidget::ensurePolished() const QList<QObject*> children = d->children; for (int i = 0; i < children.size(); ++i) { QObject *o = children.at(i); - if(!o->isWidgetType()) + if (!o->isWidgetType()) continue; if (QWidget *w = qobject_cast<QWidget *>(o)) w->ensurePolished(); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 9f5ba27e9e..c88d63686c 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -626,7 +626,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) QWidget *receiver = activePopupWidget; if (qt_button_down) receiver = qt_button_down; - else if(popupChild) + else if (popupChild) receiver = popupChild; QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPosition().toPoint(), event->modifiers()); QApplication::forwardEvent(receiver, &e, event); |