Results 1 to 2 of 2

Thread: Removing all Items from QListView

  1. #1
    Join Date
    May 2013
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Removing all Items from QListView

    Hi all,
    How can i delete all rows/items from a QListview.
    I am using QStandardItem to insert rows into a QListview.

    At a point i want to remove all the elements that are present in the QListview.

    can i get some code help on how to use QModelIndex or some other means to remove all elements from the QListView?

    Thank You.

  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: Removing all Items from QListView

    clear the model. The view only displays the model's content.

    Cheer,
    _

Similar Threads

  1. removing items QTreeWidget
    By Mystical Groovy in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2015, 21:58
  2. QListView removing rows problems
    By vcp in forum Qt Programming
    Replies: 5
    Last Post: 15th September 2009, 19:22
  3. Removing all items QListView
    By vcp in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2009, 18:55
  4. Removing items from qtreeview
    By Babak in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2009, 19:44
  5. removing model Items
    By gyre in forum Newbie
    Replies: 2
    Last Post: 25th November 2007, 20:10

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.