Hello. In my application I have a QListWidet I want this widget's items to be reordered so I set these properties.

Qt Code:
  1. setDefaultDropAction(Qt::MoveAction);
  2. setDropIndicatorShown(true);
  3. setDragDropMode(DragOnly);
  4. setAcceptDrops(true);
  5. setAlternatingRowColors(true);
To copy to clipboard, switch view to plain text mode 

Also If I move a list widget item out of the list widget I want to add that item as a bookmark.

Qt Code:
  1. void TabsListWidget::dragLeaveEvent(QDragLeaveEvent* event)
  2. {
  3. setDropIndicatorShown(false);
  4. setDragDropMode(NoDragDrop);
  5. setAcceptDrops(false);
  6. setAlternatingRowColors(false);
  7. QTimer::singleShot(200, this, SLOT(startDragging()));
  8. QListWidget::dragLeaveEvent(event);
  9. }
To copy to clipboard, switch view to plain text mode 

I can add the item as a bookmark but my app crashes when exit. Can anybody tell me what's wrong here?
The whole Cpp file >> http://paste.kde.org/1270/