Results 1 to 9 of 9

Thread: qlistview drag&drop problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    83

    Unhappy qlistview drag&drop problem

    Hello, I have a problem with a qlistview. I have some custom made slides in it and I have a problem with dragging them around qlistview. I enabled the drag&drop on the qlistview like this:
    Qt Code:
    1. //just for reference
    2. //QListView *iconList;
    3. iconList->setDragEnabled(true);
    4. iconList->setViewMode(QListView::IconMode);
    5. iconList->setIconSize(siz);
    6. //iconList->setSelectionMode(QAbstractItemView::SingleSelection);
    7. iconList->setGridSize(isiz);
    8. iconList->setSpacing(inc_size);
    9. iconList->setUniformItemSizes(true);
    10. iconList->setMovement(QListView::Free);
    11. //iconList->setMovement(QListView::Snap);
    12. iconList->setAcceptDrops(true);
    13. iconList->setDropIndicatorShown(true);
    14. iconList->setResizeMode(QListView::Adjust);
    To copy to clipboard, switch view to plain text mode 

    If i start dragging from the top item it shows the marker but it's in the top left position. If i continue dragging (and move outside the widget area and than back -still dragging), the marker appears at the right position and stays that way until i realease the item All of the following dragging continued by the previous dragging is made completely ok (the marker is right where it should be.
    Does anyone have any idea??
    ps. I use this for the drag events... ( if I use qlistview events the result is absolutely awfull...)
    Qt Code:
    1. void MListView::dropEvent(QDropEvent * event) {
    2. //QListView::dropEvent(event);
    3. QAbstractItemView::dropEvent(event);
    4. }
    5.  
    6. void MListView::dragMoveEvent(QDragMoveEvent * event) {
    7. //QListView::dragMoveEvent(event);
    8. QAbstractItemView::dragMoveEvent(event);
    9. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by moowy; 10th October 2006 at 11:04.

Similar Threads

  1. Problem with drag&drop in qlistview
    By mambo in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2006, 16:14
  2. QListView & backgroundBrush -> Houston we hv a problem
    By travis in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2006, 07:13
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.