In the last project, why "QWidget" class was used? 
I tried the same project with "Qmainwindow", but it gives error that QIODevice is not declared. 
I searchde the differences between them, but don't know how we know when we should choose "QMainWindow" or "QWidget" or "QDialog" class?