Hello there,
I am using TreeItem and TreeModel classes from Qt SimpleTreeModel example, except for one method that is called constantly at rate of one per second:
void TreeModel::addItem()
{
TreeItem* treeItem = new TreeItem;
rootItem->appendChild(treeItem);
emit layoutChanged();
}
void TreeModel::addItem()
{
TreeItem* treeItem = new TreeItem;
rootItem->appendChild(treeItem);
emit layoutChanged();
}
To copy to clipboard, switch view to plain text mode
As well I am using QSortFilterProxyModel following way:
model = new TreeModel;
proxyModel->setSourceModel(model);
proxyModel->setDynamicSortFilter(true);
treeView->setModel(proxyModel);
model = new TreeModel;
proxyModel = new QSortFilterProxyModel;
proxyModel->setSourceModel(model);
proxyModel->setDynamicSortFilter(true);
treeView = new QTreeView;
treeView->setModel(proxyModel);
To copy to clipboard, switch view to plain text mode
I have a stupid segfault and really need some help. Part of backtrace is below:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000000000000a in QSortFilterProxyModelPrivate:: proxy_to_source ()
(gdb) bt
#0 0x000000000000000a in QSortFilterProxyModelPrivate:: proxy_to_source ()
#1 0x000000000000000b in QSortFilterProxyModel::mapToSource ()
Don't know will it help or no, but segfault repeats almost always after switching from fullscreen to normal.
Where is the problem (imo, it is after layoutChanged() signal is emitted) and how can I fix it?
I've read almost the whole Google and found some relative problems where it was advised to reimplement mapToSource() and mapFromSource(). But I can't make it right due to lack of skills.
Really looking forward for your help. Big thanks in advance!
Bookmarks