need this (should probably investigate if using a QEventLoop and a separate thread is a good idea)