Modeltest

From Qt Labs

Jump to: navigation, search
ModelTest
Project logo: Modeltest.png
Platforms: Mac/Win/Linux
Qt version: 4.x
License: GPL
Depends on: None
   ModelTest blogs
   
ModelTest forum
Subversion:
svn://labs.trolltech.com/svn/itemviews/modeltest




[edit] ModelTest

[edit]

ModelTest provides a way to check for common errors in implementations of QAbstractItemModel.

ModelTest continuously checks a model as it changes, helping to verify the state and catching many common errors the moment they show up.

[edit]

Some of the conditions caught include:

  • Verifying X number of rows have been inserted in the correct place after the signal rowsAboutToBeInserted() says X rows will be inserted.
  • The parent of the first index of the first row is a QModelIndex()
  • Calling index() twice in a row with the same values will return the same QModelIndex
  • If rowCount() says there are X number of rows, model test will verify that is true.
  • Many possible off by one bugs
  • hasChildren() returns true if rowCount() is greater then zero.
  • and many more...


The code can be checked out with subversion:

svn checkout svn://labs.trolltech.com/svn/itemviews/modeltest modeltest

If you don't have svn, you can download a package instead.

[edit] Latest 5 ModelTest Blogs

(No posts for this category)



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.