I have been learning QT for a month now. I kinda get it but there is one thing that confuses me which is where I write my code. The questions : 1) Is it suppose to be in the main.cpp or the mainwindow.cpp?? I managed to make it work for both cases though. 2) Which one is the better coding practice or have the advantage later in big projects.
Thank you in advance Please post the link of the answer if this has been asked before.
Main is just a kind of regular app entry with some inits qApplication init etc.
Mainwindow manages the qApplication until it gets closed, so you should put there anything related to windows appearance, create new widgets etc.
I hope it could help you.