ich schlag mich grad mit einem problem rum dessen fehler ich einfach nicht finde, ich hoffe ihr könnt mir helfen.
und zwar meldet sich der treeview mit einer assertion an der stelle
Code: Alles auswählen
while (parent != root) {
Q_ASSERT(i > -1); // <<-- hier
viewItems[i].total += count - hidden;
parent = parent.parent();
i = viewIndex(parent);
}
die verwendung des modeltesters gibt mir folgende assertion:
Code: Alles auswählen
// Check that we can get back our real parent.
Q_ASSERT(model->parent(index) == parent);
Code: Alles auswählen
QModelIndex Model::parent(const QModelIndex & index) const
{
if(!index.isValid())
return QModelIndex();
const Nodes::Node * node
= qobject_cast<const Nodes::Node *>(
reinterpret_cast<const QObject *>(index.internalPointer()));
ASSERT(node != NULL);
if(node->type() == Nodes::Node::RootNode)
return QModelIndex();
int parentRow;
ASSERT(node->parentNode() != NULL);
parentRow = node->parentNode()->indexOfNode(node);
ASSERT(parentRow >= 0);
ASSERT(parentRow < node->parentNode()->nodeCount());
return createIndex(parentRow, 0, node->parentNode());
}