When connecting a QFileSystemWatcher to a custom slot, the slot is executed once and then hangs. The Application doesn't crash and it is still responsive.

Qt Code:
  1. #include <QtGui>
  2. #include <QDebug>
  3.  
  4. class CustomWidget : public QObject
  5. { Q_OBJECT
  6. public:
  7. CustomWidget(QWidget* parent=0) : QObject(parent)
  8. { }
  9.  
  10. public slots:
  11. void aSlot()
  12.  
  13. { qDebug() << "aSlot invoked"; }
  14. };
  15.  
  16. #include "main.moc"
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20. QApplication app(argc, argv);
  21. CustomWidget wid;
  22. watcher.removePath("/test"); //works as expected if commented out
  23. watcher.addPath("/test");
  24. QObject::connect(&watcher, SIGNAL(directoryChanged(QString)) , &wid, SLOT(aSlot() ) );
  25. return app.exec();
  26. }
To copy to clipboard, switch view to plain text mode 

I am using a mac to run the QTCreator application, and this may be the issue.
I am using an xml file that I am changing while the application runs, I want the extracted values to update some progress bars. It does update once, but then nothing changes after the xml file is changed the second time
Any time I update a file I want the custom slot to be run. It is run the first time and then hangs.
I tested this by adding a second variable of type QFileSystemWatcher which is connected to the same custom slot. The behaviour is the same for both files, it updates once but then nothing.
I assume the problem is with QFileSystemWatcher.