Skip to content

Commit 3c1ef52

Browse files
committed
Apply clang-format
1 parent 143a1dc commit 3c1ef52

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

qt/HelloQt.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#include <QLabel>
66
#include <QDebug>
77

8-
HelloQt::HelloQt(QWidget *parent) : QWidget(parent) {
8+
HelloQt::HelloQt(QWidget *parent) : QWidget(parent)
9+
{
910
// The memory management is not done explicitly but by using the parent
1011
// relationship built into Qt
1112
// The tr calls are not strictly neccesary, but it is all that is needed for
@@ -31,17 +32,18 @@ HelloQt::HelloQt(QWidget *parent) : QWidget(parent) {
3132
// match
3233
connect(pushButton, &QPushButton::clicked, this, &HelloQt::writeToDebug);
3334
// Lambdas can also be used as can ordinary freestanding functions
34-
connect(directButton, &QPushButton::clicked,
35-
[]() { qDebug() << tr("I am in line"); });
35+
connect(directButton, &QPushButton::clicked, []() { qDebug() << tr("I am in line"); });
3636
// Most usefull signals and slots are already built into the framework.
37-
connect(fatal, &QPushButton::clicked, this, &HelloQt::close); // could just use close
37+
connect(fatal, &QPushButton::clicked, this, &HelloQt::close);// could just use close
3838
};
3939

40-
HelloQt::~HelloQt() {
40+
HelloQt::~HelloQt()
41+
{
4142
// Nothing to do here, the parent system makes sure that all the elements that
4243
// are parented to this is cleaned up
4344
}
4445

45-
void HelloQt::writeToDebug(void) {
46+
void HelloQt::writeToDebug(void)
47+
{
4648
qDebug() << tr("I don't know what I was supposed to debug here...");
4749
}

qt/HelloQt.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
class HelloQt : public QWidget
44
{
5-
Q_OBJECT // Very Important, this is all the magic that is needed
6-
public:
7-
explicit HelloQt(QWidget* parent = nullptr);
8-
~HelloQt();
9-
private slots:
10-
void writeToDebug();
11-
5+
Q_OBJECT;// Very Important, this is all the magic that is needed
6+
public:
7+
explicit HelloQt(QWidget *parent = nullptr);
8+
~HelloQt();
9+
private slots:
10+
void writeToDebug();
1211
};

qt/qtMain.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#include "HelloQt.hpp"
22
#include <QApplication>
33

4-
int main(int argc, char* argv[])
4+
int main(int argc, char *argv[])
55
{
66
QApplication app(argc, argv);
77
HelloQt dialog;
88
dialog.show();
99

10-
return app.exec(); // this runs the main event loop and sees to it that cleanup is done
10+
return app.exec();// this runs the main event loop and sees to it that cleanup is done
1111
}
12-

0 commit comments

Comments
 (0)