summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorZhang Sheng <zhangsheng@uniontech.com>2020-11-16 11:19:17 +0800
committerZhang Sheng <zhangsheng@uniontech.com>2020-11-16 12:53:37 +0000
commite13173c112b729da8f53dd2e81e8116a1ed857cf (patch)
tree49c2bce0c3349eebd0f2b62c80a1b7168ae45dc2 /src/gui/kernel
parent802e5a45baf3ac7da2cb3be06d10bdd69696fcae (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/gui/kernel')
-rw-r--r--src/gui/kernel/qaction.cpp10
-rw-r--r--src/gui/kernel/qcursor.cpp2
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/kernel/qpalette.cpp22
-rw-r--r--src/gui/kernel/qwindow.cpp2
6 files changed, 21 insertions, 21 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 0da5667c1d..d3a1c069f0 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -511,13 +511,13 @@ QAction::~QAction()
void QAction::setActionGroup(QActionGroup *group)
{
Q_D(QAction);
- if(group == d->group)
+ if (group == d->group)
return;
- if(d->group)
+ if (d->group)
d->group->removeAction(this);
d->group = group;
- if(group)
+ if (group)
group->addAction(this);
d->sendDataChanged();
}
@@ -652,7 +652,7 @@ QString QAction::text() const
{
Q_D(const QAction);
QString s = d->text;
- if(s.isEmpty()) {
+ if (s.isEmpty()) {
s = d->iconText;
s.replace(QLatin1Char('&'), QLatin1String("&&"));
}
@@ -1130,7 +1130,7 @@ void QAction::activate(ActionEvent event)
}
if (!guard.isNull())
emit triggered(d->checked);
- } else if(event == Hover) {
+ } else if (event == Hover) {
emit hovered();
}
}
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index e70f6ac79b..715cc76cc9 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -719,7 +719,7 @@ QCursorData::~QCursorData()
/*! \internal */
void QCursorData::cleanup()
{
- if(!QCursorData::initialized)
+ if (!QCursorData::initialized)
return;
for (int shape = 0; shape <= Qt::LastCursor; ++shape) {
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f7e07092dd..d396f11efb 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1948,7 +1948,7 @@ bool QGuiApplication::notify(QObject *object, QEvent *event)
*/
bool QGuiApplication::event(QEvent *e)
{
- if(e->type() == QEvent::LanguageChange) {
+ if (e->type() == QEvent::LanguageChange) {
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
for (auto *topLevelWindow : QGuiApplication::topLevelWindows()) {
if (topLevelWindow->flags() != Qt::Desktop)
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 5d52ba139d..5d2a95c33f 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -964,7 +964,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
{
QKeySequence ret;
- if(qt_sequence_no_mnemonics)
+ if (qt_sequence_no_mnemonics)
return ret;
bool found = false;
@@ -1176,7 +1176,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
QStringView accelRef(accel);
- if(p > 0)
+ if (p > 0)
accelRef = accelRef.mid(p + 1);
int fnum = 0;
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index f5d010aa26..963526c153 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -734,8 +734,8 @@ QPalette::operator QVariant() const
const QBrush &QPalette::brush(ColorGroup gr, ColorRole cr) const
{
Q_ASSERT(cr < NColorRoles);
- if(gr >= (int)NColorGroups) {
- if(gr == Current) {
+ if (gr >= (int)NColorGroups) {
+ if (gr == Current) {
gr = currentGroup;
} else {
qWarning("QPalette::brush: Unknown ColorGroup: %d", (int)gr);
@@ -832,7 +832,7 @@ void QPalette::detach()
x->br[grp][role] = d->br[grp][role];
}
x->resolveMask = d->resolveMask;
- if(!d->ref.deref())
+ if (!d->ref.deref())
delete d;
d = x;
}
@@ -866,7 +866,7 @@ bool QPalette::operator==(const QPalette &p) const
return true;
for(int grp = 0; grp < (int)NColorGroups; grp++) {
for(int role = 0; role < (int)NColorRoles; role++) {
- if(d->br[grp][role] != p.d->br[grp][role])
+ if (d->br[grp][role] != p.d->br[grp][role])
return false;
}
}
@@ -881,26 +881,26 @@ bool QPalette::operator==(const QPalette &p) const
*/
bool QPalette::isEqual(QPalette::ColorGroup group1, QPalette::ColorGroup group2) const
{
- if(group1 >= (int)NColorGroups) {
- if(group1 == Current) {
+ if (group1 >= (int)NColorGroups) {
+ if (group1 == Current) {
group1 = currentGroup;
} else {
qWarning("QPalette::brush: Unknown ColorGroup(1): %d", (int)group1);
group1 = Active;
}
}
- if(group2 >= (int)NColorGroups) {
- if(group2 == Current) {
+ if (group2 >= (int)NColorGroups) {
+ if (group2 == Current) {
group2 = currentGroup;
} else {
qWarning("QPalette::brush: Unknown ColorGroup(2): %d", (int)group2);
group2 = Active;
}
}
- if(group1 == group2)
+ if (group1 == group2)
return true;
for(int role = 0; role < (int)NColorRoles; role++) {
- if(d->br[group1][role] != d->br[group2][role])
+ if (d->br[group1][role] != d->br[group2][role])
return false;
}
return true;
@@ -1036,7 +1036,7 @@ static void readV1ColorGroup(QDataStream &s, QPalette &pal, QPalette::ColorGroup
QDataStream &operator>>(QDataStream &s, QPalette &p)
{
- if(s.version() == 1) {
+ if (s.version() == 1) {
p = QPalette();
readV1ColorGroup(s, p, QPalette::Active);
readV1ColorGroup(s, p, QPalette::Disabled);
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index e761fe8e4c..546a90b2e9 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -675,7 +675,7 @@ WId QWindow::winId() const
{
Q_D(const QWindow);
- if(!d->platformWindow)
+ if (!d->platformWindow)
const_cast<QWindow *>(this)->create();
return d->platformWindow->winId();