// using Qt. It's probably not bug free, and it's not multithreaded