Use QMainWindow instead of QDialog, add normal toolbar instead of QToolButtons. Also fix some issues caused by Qt5 switch.