Or you can do the following:
Create a custom QWidget with a horizontal layout, were you place a QLabel on the left with your text and a QLabel on the right with a pixmap with an X.
You need to enable mousetracking and reimplement mousedown/up/pressed to catch various the mouse actions. (and paint if you want visual changed on down, up, active etc...)

QAssistant does this on it's own tabs, so I guess you can take a look at the code for that one. Assistant is not using toolbuttons, but a QTabBar with cornerwidgets on the tabs. and since you can style the TabBar with Style sheets, it's not to hard to get it working. The cool thing with corner widgets, is that you can add any QWidget or subclass in there