I am making open source file manager with the ability to encrypt and decrypt file/files according given password called Cryptofm. You can get the code from [here](http://cryptofm.com/) - the first version. I want to add status dialog, representing loading screen with progress bar for `Dialog::encAll()` slot, after the progress bar reached max value to close the statusdialog. I found out that I must firstly recursively find the total size of all files in the folder(in TreeView context menu option Size) - slot `Dialog::dirSize()` is doing this with the help of the function `Dialog::getSelectedTreeItemSize()`, and then set the progress bar property maximum to that value. Total size calculation proccess may take again a lot of time so I need another dialog with something moving to just indicate the process is executing. The whole thing should be something like the process of pasting very large folder with a lot of files in Windows 7.

Process of getting the total size:

[![enter image description here](https://i.stack.imgur.com/KAIva.jpg)](https://i.stack.imgur.com/KAIva.jpg)

Process of pasteing untill progress bar reach the total size:

[![enter image description here](https://i.stack.imgur.com/O4WS0.jpg)](https://i.stack.imgur.com/O4WS0.jpg)

The problem is that almost all functions,actions and etc are implemented in the Dialog class and I am not able to use threads - after adding QThread like this `Dialog : public QDialog, public QThread` in dialog.h(to be able to implement run() method) the program gives some errors:

> 
> C:\Users\niki\Documents\EncryptionProject\dialog.cpp:41: error: C2594:
> 'argument' : ambiguous conversions from 'Dialog \*const ' to 'QObject
> \*'
> 
> 
> C:\Users\niki\Documents\EncryptionProject\dialog.cpp:46: error: C2594:
> 'argument' : ambiguous conversions from 'Dialog \*const ' to 'QObject
> \*'
> 
> 
> C:\Users\niki\Documents\EncryptionProject\dialog.cpp:51: error: C2385:
> ambiguous access of 'connect' could be the 'connect' in base 'QObject'
> or could be the 'connect' in base 'QObject'
> 
> 
> 

And another 31 errors, so:

* What are the best options here?
* Should I use MVC or another pattern?
* Should I use threads?