I think it is easier to use LineEdit and listen for the onchange signal. In swap slot search email inside LineEdit text using RegExp. If you find a suitable email address (possibly surrounded by spaces), add a shortcut with a delete icon in front of LineEdit and remove the added email from the LineEdit text. It's all!
source share