Results 1 to 6 of 6

Thread: QListWidget, access to index and item after drag and drop event

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QListWidget, access to index and item after drag and drop event

    Function QListWidget::item(int) won't work too because inserted item is filled with data after sinal rowsInserted. When I take data when signal is emitted inserted item is empty(yes no data, just empty item).
    I solved this problem but in some awful way. I created additional variables and when items are dragged and dropped first is emitted signal rowsInserted(I store a index as source of data), then item is added to list, next signal emitted id rowsRemoved(I add data now and remove unnecessary item). Awful isn't it? But it works!

    UPDATE:
    Well there is one drawback. When user hold CTRL when dragging(copy action) there is no rowsRemoved signal emitted
    Well i will fix this problem someday :P
    Last edited by FarAway; 7th July 2015 at 15:30.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget, access to index and item after drag and drop event

    Well, if you want to call the model's data method, you can ask if for a QModelindex for any row you want.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 30th January 2014, 06:46
  2. Replies: 4
    Last Post: 25th January 2013, 10:14
  3. to use drag & drop on QListWidget
    By giorgik in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2012, 18:00
  4. Drag and drop between QListWidget's
    By estanisgeyer in forum Qt Programming
    Replies: 4
    Last Post: 17th February 2011, 04:29
  5. Replies: 3
    Last Post: 10th June 2010, 15:13

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.