Results 1 to 2 of 2

Thread: How to move a item using drag&drop within a tableview

  1. #1
    Join Date
    Nov 2013
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default How to move a item using drag&drop within a tableview

    Hi,

    I want to move my item from "from index" to "To index" using drag and drop.
    I have set the drag and drop.

    ui.tableView->setSelectionMode(QAbstractItemView::SingleSelecti on);
    ui.tableView->setDragEnabled(true);
    ui.tableView->setAcceptDrops(true);
    ui.tableView->setDropIndicatorShown(true);
    ui.tableView->setModel(m_pTableModel);
    ui.tableView->setDragDropOverwriteMode(true);
    ui.tableView->setDragDropMode(QAbstractItemView::InternalMove );


    By this the dragged item is getting moved from the view itself. Please suggest me some idea...



    Thanks ...

  2. #2
    Join Date
    Nov 2013
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to move a item using drag&drop within a tableview

    do i need to set MIMEData for this ??
    please help me out.

Similar Threads

  1. Replies: 2
    Last Post: 30th January 2014, 06:46
  2. How to Drag and Drop working with tableview?
    By diginikkari in forum Newbie
    Replies: 2
    Last Post: 22nd October 2012, 18:02
  3. Qt move picture per drag and drop
    By Qiieha in forum Qt Programming
    Replies: 0
    Last Post: 14th June 2011, 11:02
  4. Replies: 0
    Last Post: 2nd June 2010, 17:52
  5. Drag an item from QTreeWidget and drop in TableView
    By steg90 in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2007, 11:42

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.