diff --git a/src/cmlib-example/fsh.hpp b/src/cmlib-example/fsh.hpp index 9db3a41..d0a32c0 100644 --- a/src/cmlib-example/fsh.hpp +++ b/src/cmlib-example/fsh.hpp @@ -2,10 +2,10 @@ #include -class FileSignalHandler : public QObject { +class FileSignalHandler : public QObject +{ Q_OBJECT public: - Q_SLOT void process() {}; + Q_SLOT void process() {} }; - diff --git a/src/cmlib-example/main.cpp b/src/cmlib-example/main.cpp index 3175798..8165e5b 100644 --- a/src/cmlib-example/main.cpp +++ b/src/cmlib-example/main.cpp @@ -1,15 +1,15 @@ #include "cmlib_private_config.hpp" +#include "fsh.hpp" #include #include #include -#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 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 +