updated to be based on QMainwindow