is there any widget that will do this, off the shelf?
Yes - QPushButton
Connect the clicked() signal to a slot, in that slot emit a QContextMenuEvent.