Find file in folder recursive with Qt.


This function returns the absolute path of a file in a folder (or subfolder).
It searchs recursively in all subfolders until it finds the file or return an empty QString if the file is not found.


QString findFile( QString dir, QString fileName )
{
    QDir pathDir( dir );
    for( QFileInfo fileInfo : pathDir.entryInfoList() )
    {
        if( fileInfo.isFile() )
        {
            if( fileInfo.fileName() == fileName ) 
                return fileInfo.absoluteFilePath();
        }
        else if( !fileInfo.fileName().endsWith(".") )
        {
            QString found = findFile( fileInfo.absoluteFilePath(), fileName );
            if( !found.isEmpty() ) return found;
        }
    }
    return "";
}



Connect QObject signal to non QObject class.

Usually you need to derive from QObject and use the Q_OBJECT macro to connect to some slot in your class.
But sometimes you want to connect a QObject signal to do something in a non QObject class.

There are several posible reasons to not derive from QObject or use the Q_OBJECT macro, but in any case you can connect to a non QObejct class using lambdas:

```c
  // Connect to menu action

  QMenu* menu:

  QAction* myAction = menu->addAction( QIcon(":/myIcon.svg"), "Do something" );

  QObject::connect( myAction, &QAction::triggered, [=](){ myFuncion(); });



  // Connect to QPushButton

  QPushButton* button = new QPushButton();

  QObject::connect( button, &QPushButton::released, [=](){ onButtonReleased(); });
```


Fast linked list without list

If you need a very fast way to iterate over a list of objects and call the same method on all of them, then here is a posible solution. Der...