Results 1 to 2 of 2

Thread: free movement in QListView

  1. #1
    Join Date
    May 2010
    Posts
    13

    Default free movement in QListView

    Hello folks!
    Greetings.

    I have created a part of my GUI application with an area where the files of a particular pattern in a directory are listed as list view items. I would like to be able to drag the items and drop them at a different order within that same listing. If I use icon view instead, the drag and drop reordering works.

    The problem is in the list view. If I don't set the movement to "free" explicitly, the GUI shows that dragging and dropping is not working, as I move the mouse, different items get selected. But if I make the movement free, I can drag the item by clicking on it, but the cursor changes to "not allowed" icon and I cannot drop the item anywhere else in that list ... i.e. the item cannot be moved.

    Here is a part of my statements that I am using to display the list view:
    listFilesView = new QListView(this);
    listFilesView->setViewMode(QListView::ListMode);
    listFilesView->setMovement(QListView::Free);
    listFilesView->setDragEnabled(true);
    listFilesView->setAcceptDrops(true);
    listFilesView->setSelectionMode(QAbstractItemView::ExtendedSelec tion);
    listFilesView->setDropIndicatorShown(true);
    listFilesView->setModel(modelFiles);

    If hope these statements give enough info to allow somebody to tell me what I am missing in order to get the drag and drop reorder functionality.what I am missing here?

    Thank you.

  2. #2
    Join Date
    May 2010
    Posts
    13

    Default Re: free movement in QListView

    No response. Seriously, guy?

    Could some at least confirm if drag and drop reordering is even possible with QListView by allowing movement to be "free" or do I have to do some other stuff in the model?

    Thanks.

Similar Threads

  1. line movement
    By zgulser in forum Qt Programming
    Replies: 7
    Last Post: 17th August 2009, 18:01
  2. Can we restrict the movement of a Qt Window?
    By Frank J. Lhota in forum Qt Programming
    Replies: 4
    Last Post: 21st October 2008, 20:34
  3. What to free or not to free, that is the question
    By bruccutler in forum Qt Programming
    Replies: 1
    Last Post: 25th July 2007, 05:04
  4. Limit Window Movement
    By abbapatris in forum Qt Programming
    Replies: 20
    Last Post: 19th July 2007, 13:54
  5. Block Widget Movement
    By shyam prasad in forum Qt Programming
    Replies: 5
    Last Post: 3rd April 2007, 18:27

Tags for this Thread

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.