Форматирование кода

This commit is contained in:
Andrei Astafev 2020-04-19 09:49:38 +03:00
parent 281ec272d8
commit 68315ce08d
2 changed files with 15 additions and 14 deletions

View File

@ -2,10 +2,10 @@
#include <QObject>
class FileSignalHandler : public QObject {
class FileSignalHandler : public QObject
{
Q_OBJECT
public:
Q_SLOT void process() {};
Q_SLOT void process() {}
};

View File

@ -1,15 +1,15 @@
#include "cmlib_private_config.hpp"
#include "fsh.hpp"
#include <QCoreApplication>
#include <QDebug>
#include <QFile>
#include "fsh.hpp"
// function args by ref
int qStringToInt(QString s)
int qStringToInt( QString s )
{
return s.toInt();
return( s.toInt() );
}
@ -18,9 +18,9 @@ int main( int argc, char** argv )
QCoreApplication app( argc, argv );
// qt-keywords
QList<int> il;
QList< int > il;
il << 111 << 222;
foreach(int i, il)
foreach( int i, il )
{
qDebug() << i;
}
@ -29,25 +29,26 @@ int main( int argc, char** argv )
// string allocations
sl << "111" << "222";
// loop add ref
for (const auto &s: sl)
for ( const auto& s: sl )
{
qDebug() << s;
}
// loop qasconst
for (auto s: sl)
for ( auto s: sl )
{
s.append("0");
s.append( "0" );
}
// function args by ref
QString s { "100" };
auto ir = qStringToInt(s);
auto ir = qStringToInt( s );
// old style connect
QFile f;
FileSignalHandler fsh;
QObject::connect(&f, SIGNAL(aboutToClose()), &fsh, SLOT(process()));
QObject::connect( &f, SIGNAL(aboutToClose()), &fsh, SLOT(process()) );
return( 0 );
}
} // main