PDA

View Full Version : Crash while checking the index is of particular level of a tree



kapil sharma
27th November 2008, 08:00
hi,

I have a QModelIndex const& index & a tree of five levels,starting from Level1 to Level5.

For checking the levels we have isLevel functions for each level, which return bool value,
& we have to only pass the modelIndex(it contain the row number, colomn number & the parent pointer), which we want to check.

Now i want to check that the given model index(index) is of which level, the small code i am using is shown below.

QModelIndex const& index
QAbstractItemModel* model;
bool flag;
flag = model->IsLevel2(index );

when i am using this it is crashing, Suggest something what i should do

spirit
27th November 2008, 08:21
it would be better if you provide more code. according to snippet of you code hard to say where problem is.