|
LibEngsas
|
Class to test all basic stuff of QAbstractItemModels. More...
#include <modeltest.h>
Inheritance diagram for ModelTest:
Collaboration diagram for ModelTest:Classes | |
| struct | Changing |
Public Member Functions | |
| ModelTest (QAbstractItemModel *model, QObject *parent=NULL, int verbose=1) | |
Protected Slots | |
| void | runAllTests () |
| void | layoutAboutToBeChanged () |
| void | layoutChanged () |
| void | rowsAboutToBeInserted (const QModelIndex &parent, int start, int) |
| void | rowsInserted (const QModelIndex &parent, int start, int end) |
| void | rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
| void | rowsRemoved (const QModelIndex &parent, int start, int end) |
Private Slots | |
| void | nonDestructiveBasicTest () |
| void | rowCount () |
| void | columnCount () |
| void | hasIndex () |
| void | index () |
| void | parent () |
| void | data () |
Private Member Functions | |
| void | checkChildren (const QModelIndex &parent, int currentDepth=0) |
| void | init () |
Private Attributes | |
| QAbstractItemModel * | model |
| QStack< Changing > | insert |
| QStack< Changing > | remove |
| bool | fetchingMore |
| int | verboseLevel |
| QList< QPersistentModelIndex > | changing |
Class to test all basic stuff of QAbstractItemModels.
This class is from QtLabs. It is designed to watch a given model and run some checks after events like inserting or remove items. So use it like this:
| ModelTest::ModelTest | ( | QAbstractItemModel * | _model, |
| QObject * | parent = NULL, |
||
| int | verbose = 1 |
||
| ) |
Connect to all of the models signals. Whenever anything happens recheck everything.
Here is the call graph for this function:
|
private |
Called from the parent() test.
A model that returns an index of parent X should also return X when asking for the parent of the index.
This recursive function does pretty extensive testing on the whole model in an effort to catch edge cases.
This function assumes that rowCount(), columnCount() and index() already work. If they have a bug it will point it out, but the above tests should have already found the basic bugs because it is easier to figure out the problem in those tests then this one.
Here is the call graph for this function:
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::columnCount() and hasChildren()
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::data()
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::hasIndex()
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::index()
Here is the caller graph for this function:
|
private |
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedslot |
Here is the caller graph for this function:
|
protectedslot |
Here is the caller graph for this function:
|
privateslot |
nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense.
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::parent()
Here is the call graph for this function:
Here is the caller graph for this function:
|
privateslot |
Tests model's implementation of QAbstractItemModel::rowCount() and hasChildren()
Models that are dynamically populated are not as fully tested here.
Here is the caller graph for this function:
|
protectedslot |
Store what is about to be inserted to make sure it actually happens
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedslot |
Store what is about to be inserted to make sure it actually happens
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedslot |
Confirm that what was said was going to happen actually did
Here is the caller graph for this function:
|
protectedslot |
Confirm that what was said was going to happen actually did
Here is the caller graph for this function:
|
protectedslot |
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.8