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

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> #include <QObject>
class FileSignalHandler : public QObject { class FileSignalHandler : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
Q_SLOT void process() {}; Q_SLOT void process() {}
}; };

View File

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