Results 1 to 4 of 4

Thread: QTableWidget - Selection and Drag and drop

  1. #1
    Join Date
    Dec 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default QTableWidget - Selection and Drag and drop

    Hello everyone !

    I'm french, sorry if my english language is not very good.
    I would like to know if there is a method to select cells of QTableWidget and then drag and drop its.
    The problem is that if we allow the selection, we cannot use drag and drop and if we allow the drag and drop function, the selection doesn't work.

    So, i would like to add a small shape (if it is possible) on the bottom right corner for all cells that permit to select cells on mouse pressed button like excel and if we press mouse button on the cells, it is the drag and drop enabled.

    Thanks

    Mohaskh
    Last edited by mohaskh; 29th December 2015 at 18:16.

  2. #2
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget - Selection and Drag and drop

    Qt Code:
    1. tableWidget->setDragDropMode(QAbstractItemView::DragDrop);
    To copy to clipboard, switch view to plain text mode 
    allows you to do both select multiple cells/rows & drag them

    check QAbstractItemView::DragDropMode for other flags.
    Last edited by prasad_N; 31st December 2015 at 06:01.
    Thanks :-)

  3. #3
    Join Date
    Dec 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Post Re: QTableWidget - Selection and Drag and drop

    Thanks for your response.
    I tried to use this method but i cannot select cells and rows.

    With :
    Qt Code:
    1. tableWidget->setDragDropMode(QAbstractItemView::DragDrop);
    To copy to clipboard, switch view to plain text mode 
    I can drag and drop only one item and i want to drag and drop a list of items after selecting them with the mouse.

    Thanks
    Last edited by mohaskh; 31st December 2015 at 14:07.

  4. #4
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget - Selection and Drag and drop

    you need to use CTRL for multiple selection & SHIFT for bulk selection.
    Thanks :-)

Similar Threads

  1. Replies: 3
    Last Post: 15th December 2015, 11:52
  2. Replies: 0
    Last Post: 29th July 2015, 08:34
  3. Drag and drop QTreeWidgetItem to QTableWidget
    By RomainGallard in forum Qt Programming
    Replies: 5
    Last Post: 11th October 2010, 13:02
  4. Drag and Drop QTableWidget in UI file.
    By tpf80 in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2009, 23:02
  5. Drag & Drop using QTableWidget
    By Israa in forum Qt Programming
    Replies: 21
    Last Post: 12th April 2007, 19:35

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.