PDA

View Full Version : qdragLeaveEvent Problem



Furkan
29th December 2010, 17:42
Hello. In my application I have a QListWidet I want this widget's items to be reordered so I set these properties.


setDefaultDropAction(Qt::MoveAction);
setDropIndicatorShown(true);
setDragDropMode(DragOnly);
setAcceptDrops(true);
setAlternatingRowColors(true);

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


void TabsListWidget::dragLeaveEvent(QDragLeaveEvent* event)
{
setDropIndicatorShown(false);
setDragDropMode(NoDragDrop);
setAcceptDrops(false);
setAlternatingRowColors(false);
QTimer::singleShot(200, this, SLOT(startDragging()));
QListWidget::dragLeaveEvent(event);
}

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/

high_flyer
30th December 2010, 09:47
I can add the item as a bookmark but my app crashes when exit.
Run it in a debugger, and see which line in your code is the last to be called.