virtual QList<QStandardItem *> valueWalker(ExtcapValueList list, QStringList &defaults) { ExtcapValueList::iterator iter = list.begin(); QList<QStandardItem *> items; while ( iter != list.end() ) { QStandardItem * item = new QStandardItem((*iter).value()); if ( (*iter).enabled() == false ) { item->setSelectable(false); } else item->setSelectable(true); item->setData((*iter).call(), Qt::UserRole); if ((*iter).isDefault()) defaults << (*iter).call(); item->setEditable(false); QList<QStandardItem *> childs = valueWalker((*iter).children(), defaults); if ( childs.length() > 0 ) item->appendRows(childs); items << item; ++iter; } return items; }
void ExtcapValue::setChildren(ExtcapValueList children) { ExtcapValueList::iterator iter = children.begin(); while ( iter != children.end() ) { (*iter)._depth = _depth + 1; ++iter; } _children.append(children); }