Results 1 to 2 of 2

Thread: qdragLeaveEvent Problem

  1. #1
    Join Date
    Apr 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Question qdragLeaveEvent Problem

    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/

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: qdragLeaveEvent Problem

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.