Hi,

In my qml interface I have a QAbstractItemModel in a ListView and need to 
know whether a particular item hasChildren(), so that when it is clicked, I 
can change the contents of the view to show its children.

Currently I've hacked it with a custom role and return hasChildren(index) in 
my data() method in my base model, but this doesn't work through proxy 
models if they filter out all children (common in my case).

Better would be for QDeclarativeModel or whatever it's called to call 
hasChildren on the model so that I can do something like this in QML in my 
delegate:

Rectangle {
  id : hasChildrenIndicator
  opacity : model.hasChildren ? 1 : 0
}

Can that be added?

All the best,

Steve.
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to