Results 1 to 2 of 2

Thread: qt4 - xp - model/view

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default qt4 - xp - model/view

    I have a model called "model" attached to a TreView called "treeView.
    In QT4 there was a way to empty all rows.

    None of the code below gives result :
    Qt Code:
    1. qRecap->removeRows(0, qRecap->rowCount(QModelIndex()), QModelIndex());
    2. qRecap->clear();
    To copy to clipboard, switch view to plain text mode 


    qRecap is the model.
    qRecap has no member removeRows or clear.

    How can i remove all entries from the model ?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qt4 - xp - model/view

    What type of model is that?

    - The clear() method exists for a QStandardItemModel, and should be enough to remove all items in the model.
    - The removeRows() method (but not implementation, necessarily) exists for any QAbstractItemModel derivate so there is supposedly something wrong with your qRecap pointer...

  3. The following user says thank you to jpn for this useful post:

    incapacitant (14th March 2006)

Similar Threads

  1. Drag & drop with model/view (Qt4)
    By yogeshm02 in forum Qt Programming
    Replies: 16
    Last Post: 19th September 2011, 20:36
  2. Questions on Model/View
    By joshuajcarson in forum Qt Programming
    Replies: 7
    Last Post: 26th September 2008, 21:29
  3. model/view editing question
    By KShots in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2008, 17:52
  4. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 11:04
  5. MODEL/VIEW programming
    By mira in forum Newbie
    Replies: 3
    Last Post: 21st April 2006, 11:19

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.