Results 1 to 5 of 5

Thread: QTableWidget, dropping between the rows shall insert the item

  1. #1
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableWidget, dropping between the rows shall insert the item

    Hi all,

    I have an opposite problem to the one described by sergiomar73 in the thread "QtableWidget that don't accept drop item between rows?"

    I'd like to INSERT the dragged row of the QTableWidget BETWEEN two other rows. The drag and drop works OK, the insertion is possible only between the rows, but item disappears instead of to be inserted.
    Optimally, the gap after the moved item shall be closed ( according part of the rows shall be moved)

    any idea how to to do this?

    great thanks for any help

  2. #2
    Join Date
    Sep 2010
    Posts
    62
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableWidget, dropping between the rows shall insert the item

    Hi,

    I've found out that in the QTableView, the feature works correctly. The problem is only with the QTableWidget. Is this a bug or a feature ???

    regards

  3. #3
    Join Date
    Jun 2014
    Posts
    98
    Thanks
    43
    Thanked 4 Times in 4 Posts
    Platforms
    Windows

    Default Re: QTableWidget, dropping between the rows shall insert the item

    I am having the same problem. It works fine in QListWidget, but in QTableWidget it drags content from row i, drops onto row j, overwriting the content in row j, and row i is now blank

  4. #4
    Join Date
    Jun 2014
    Posts
    98
    Thanks
    43
    Thanked 4 Times in 4 Posts
    Platforms
    Windows

    Default Re: QTableWidget, dropping between the rows shall insert the item

    I just posted about this at Stack Overflow too, just to see if there is something obvious I am missing:
    http://stackoverflow.com/questions/2...n-qtablewidget

  5. #5
    Join Date
    Jun 2014
    Posts
    98
    Thanks
    43
    Thanked 4 Times in 4 Posts
    Platforms
    Windows

    Default Re: QTableWidget, dropping between the rows shall insert the item

    Someone at Stack Overflow answered. It's tricky, but doable:
    http://stackoverflow.com/a/26311179/1886357

    For a noob like me it is actually a beautiful example to work through.

Similar Threads

  1. QtableWidget that don't accept drop item between rows?
    By sergiomar73 in forum General Programming
    Replies: 3
    Last Post: 15th October 2010, 22:55
  2. Dropping on QTableWidget's child
    By blacker1611 in forum Qt Programming
    Replies: 2
    Last Post: 7th July 2010, 12:25
  3. TableView + SqlQueryModel: can't insert or edit rows
    By jiveaxe in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2008, 22:55
  4. Insert rows...
    By steg90 in forum Qt Programming
    Replies: 13
    Last Post: 18th September 2007, 14:36
  5. insert Item to my QTreeWidget
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 28th February 2006, 16:42

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.