Please read the docs on QMainWindow to see what the central widget is and how are toolbars related to the rest of the main window family and friends. Your current code makes completely no sense.