Results 1 to 5 of 5

Thread: How to delete item from QListView?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to delete item from QListView?

    Hi,

    I would like to delete selected item from QListView, but I don't know how to get current index. I have code:

    Qt Code:
    1. list << "1" << "2" << "3" << "4" << "5";
    2.  
    3. model->setStringList(list);
    4.  
    5. QListView *listView = new QListView;
    6. listView->setModel(model);
    To copy to clipboard, switch view to plain text mode 

    So, what is the simpliest way to do this? Thanks in advance.
    Last edited by damon_1990; 4th October 2011 at 20:22.

Similar Threads

  1. Replies: 1
    Last Post: 4th August 2011, 22:36
  2. Replies: 3
    Last Post: 21st July 2010, 07:40
  3. Delete item from QMap<int, QString> with shift
    By Usernаme in forum Newbie
    Replies: 1
    Last Post: 24th May 2010, 18:50
  4. How to use QMap::remove() to delete some item?
    By jedychen in forum Qt Programming
    Replies: 5
    Last Post: 18th September 2008, 07:29
  5. Replies: 5
    Last Post: 1st March 2007, 08:19

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.