A few calls to QWidget::addAction() and then QWidget::setContextMenuPolicy() with Qt::ActionsContextMenu. No need to override the context menu event handler unless you have something more complicated to do there.