Results 1 to 3 of 3

Thread: listview

  1. #1
    Join Date
    May 2009
    Posts
    129

    Default listview

    Hi

    How clear the listview . i referred the listview .i dson't get any thing


    please help me


    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: listview

    Quote Originally Posted by addu View Post
    How clear the listview .
    Qt Code:
    1. QAbstractItemModel *m = view->model();
    2. view->setModel(/*new empty model*/);
    3. delete m;
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: listview

    if you dont want to change your current model, and assuming your model is of type QStandardItemModel, here is how to do it:

    Qt Code:
    1. QStandardItemModel *mdl = (QStandardItemModel *)view->model();
    2. mdl->clear();// your view will be automatically updated by this, unless you have your own custom model
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. how to find an icon is undermouse or not in a listview
    By babu198649 in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2007, 15:06
  2. ListView and CurrentChanged
    By kroenecker in forum Newbie
    Replies: 13
    Last Post: 24th March 2007, 03:35
  3. How to return elements from a ListView
    By nikau in forum Newbie
    Replies: 1
    Last Post: 23rd January 2007, 08:44
  4. ListView Dynamic Popup menu
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 14th October 2006, 20:26
  5. filtering big listview causes slowdown
    By soul_rebel in forum KDE Forum
    Replies: 1
    Last Post: 24th May 2006, 14:31

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.