Use the KContextMenu component to display a custom context menu when the user right-clicks an element.