You can achieve that using QToolButtons laid on QToolBar available in QMainWindow