I have a delegate that gets instantiated when double clicking on an item in a QTreeWidget.
I would like to pop up a tooltip for few seconds and that it slowly disappears afterwards.

Right now I'm doing this:
Qt Code:
  1. QWidget * Test::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
  2. const QModelIndex &index) const
  3. {
  4. ...
  5. QToolTip::showText(QCursor::pos(), "test");
  6. }
To copy to clipboard, switch view to plain text mode 
The tooltip shows up for a second and disappears. How would I go about doing that?
Thanks