user interface - Why does Qt ColumnView widget crash in this situation? -


i'm testing application in qt uses qcolumnview widget. widget has 2 columns , when item in first column (parent) clicked, it's items (children) shown in second column.

the problem i'm having this:

if parent has more children there parents, application crashes if of "excess" children selected.

in other words, if there 5 parents , each parent has 5 (or less) children, fine. however, if parent has 6 or more children, application crashes if child index greater the first 5 selected.

i hope above clear.

thanks.

it turns out needed following:

if(!hasindex(row, column, parent))       return qmodelindex(); 

in "qabstractitemmodel::index()" function. didn't think view widget call "index()" out of bound row/column combinations since can use "qabstractitemmodel::rowcount()" , qabstractitemmodel::columncount()" structure of model.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -