Results 1 to 2 of 2

Thread: reset method in QAbstractTableModel

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default reset method in QAbstractTableModel

    This method is protected in the QAbstractTableModels. Therefore in my derived classes I need to publish it or create a wrapper method to allow reset when all underlying data changes.

    Question - may be I am missing something and there is another way to say to the model that the data set changes? "reset" being protected is clearly a design choice, but I am not sure why, because in each and every class that is derived from QAbstractTableModel I have to add a way to reset the data.

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: reset method in QAbstractTableModel

    Quote Originally Posted by TorAn View Post

    Question - may be I am missing something and there is another way to say to the model that the data set changes?
    You can use/emit QAbstractItemModel::layoutChanged() signal.
    Last edited by saa7_go; 2nd August 2010 at 05:07. Reason: updated contents

Similar Threads

  1. Replies: 1
    Last Post: 9th February 2010, 12:11
  2. QTextBrowser - reset source?
    By lamera in forum Qt Programming
    Replies: 1
    Last Post: 15th October 2008, 00:06
  3. Bug in Qt4.3.3 QXmlSimpleReader::reset() ?
    By Shawn in forum Qt Programming
    Replies: 9
    Last Post: 3rd March 2008, 09:14
  4. reset QwtPlot
    By sarefo in forum Qwt
    Replies: 1
    Last Post: 24th January 2008, 08:00
  5. QImage reset
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2007, 10:18

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.