Take the code from the calculator example in the documentation and modify it to use QMainWindow in place of QDialog. Then follow the excellent menus example to create menus.