Skip to content

Commit d292924

Browse files
author
tsl
committed
new clang format
1 parent 57d214d commit d292924

32 files changed

+1064
-1209
lines changed

.clang-format

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
Language: Cpp
3+
4+
BasedOnStyle: Google
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: 'false'
7+
AlignConsecutiveAssignments: 'true'
8+
AlignConsecutiveDeclarations: 'false'
9+
AlignEscapedNewlines: Left
10+
AlignOperands: 'true'
11+
AlignTrailingComments: 'true'
12+
AllowAllConstructorInitializersOnNextLine: 'false'
13+
AllowShortBlocksOnASingleLine: 'false'
14+
AllowShortCaseLabelsOnASingleLine: 'false'
15+
AllowShortFunctionsOnASingleLine: Empty
16+
AllowShortIfStatementsOnASingleLine: Never
17+
AllowShortLambdasOnASingleLine: Empty
18+
AllowShortLoopsOnASingleLine: 'false'
19+
BinPackArguments: 'true'
20+
ContinuationIndentWidth: '2'
21+
Cpp11BracedListStyle: 'true'
22+
DerivePointerAlignment: 'false'
23+
FixNamespaceComments: 'true'
24+
IndentWidth: '2'
25+
PointerAlignment: Left
26+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
27+
28+
SortIncludes: 'true'
29+
SortUsingDeclarations: 'true'
30+
31+
UseTab: Never
32+
33+
ReflowComments: false
34+
35+
...
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
#include "KM_visualize_widget.h"
22

3-
#include <QPainter>
43
#include <QColorDialog>
4+
#include <QPainter>
55

6-
QColor KMVisualizeWidget::getRb() const
7-
{
6+
QColor KMVisualizeWidget::getRb() const {
87
return Rb;
98
}
109

11-
QColor KMVisualizeWidget::getRw() const
12-
{
10+
QColor KMVisualizeWidget::getRw() const {
1311
return Rw;
1412
}
1513

16-
KMVisualizeWidget::KMVisualizeWidget(QWidget* parent) : QWidget(parent), Rb(120, 120, 120), Rw(121, 121, 121)
17-
{
14+
KMVisualizeWidget::KMVisualizeWidget(QWidget* parent)
15+
: QWidget(parent),
16+
Rb(120, 120, 120),
17+
Rw(121, 121, 121) {
1818
this->setMouseTracking(true);
1919
}
2020

21-
void KMVisualizeWidget::setRw(const QColor& c)
22-
{
21+
void KMVisualizeWidget::setRw(const QColor& c) {
2322
Rw = c;
2423
this->update();
2524
}
2625

27-
void KMVisualizeWidget::setRb(const QColor& c)
28-
{
26+
void KMVisualizeWidget::setRb(const QColor& c) {
2927
Rb = c;
3028
this->update();
3129
}
3230

33-
void KMVisualizeWidget::paintEvent(QPaintEvent* event)
34-
{
31+
void KMVisualizeWidget::paintEvent(QPaintEvent* event) {
3532
QPainter p(this);
3633

3734
p.fillRect(0, 0, this->width(), this->height(), Qt::white);
38-
p.fillRect(this->width() / 3, 0, this->width() / 3, this->height(), Qt::black);
35+
p.fillRect(this->width() / 3, 0, this->width() / 3, this->height(),
36+
Qt::black);
3937

4038
p.fillRect(0, this->height() / 3, this->width() / 3, this->height() / 3, Rw);
41-
p.fillRect(this->width() / 3, this->height() / 3, this->width() / 3, this->height() / 3, Rb);
42-
p.fillRect(2 * (this->width() / 3), this->height() / 3, this->width() / 3, this->height() / 3, Rw);
39+
p.fillRect(this->width() / 3, this->height() / 3, this->width() / 3,
40+
this->height() / 3, Rb);
41+
p.fillRect(2 * (this->width() / 3), this->height() / 3, this->width() / 3,
42+
this->height() / 3, Rw);
4343
}

apps/painty_gui/src/KM_visualize_widget.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@
33

44
#include <QWidget>
55

6-
class KMVisualizeWidget : public QWidget
7-
{
6+
class KMVisualizeWidget : public QWidget {
87
Q_OBJECT
98

109
QColor Rb;
1110
QColor Rw;
1211

13-
public:
12+
public:
1413
explicit KMVisualizeWidget(QWidget* parent = nullptr);
1514

1615
QColor getRb() const;
1716

1817
QColor getRw() const;
1918

20-
signals:
19+
signals:
2120

22-
public slots:
21+
public slots:
2322
void setRw(const QColor&);
2423
void setRb(const QColor&);
2524

26-
protected:
25+
protected:
2726
void paintEvent(QPaintEvent* event);
2827
};
2928

0 commit comments

Comments
 (0)